Browse Source

Version 2.0.0, Lua migration (#4)

See CHANGELOG.md
my-config
NTBBloodbath 4 years ago
committed by GitHub
parent
commit
6bd5bbfd5a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .gitignore
  2. 102
      CHANGELOG.md
  3. 70
      autoload/doom.vim
  4. 9
      autoload/doom/autocmds.vim
  5. 2
      autoload/doom/config.vim
  6. 21
      autoload/doom/functions.vim
  7. 2
      autoload/doom/logging.vim
  8. 21
      autoload/doom/system.vim
  9. 2
      colors/doom-one.vim
  10. 31
      config/gui.vim
  11. 94
      config/keybindings.vim
  12. 259
      config/plugins/leader-mapper.vim
  13. 12
      config/plugins/neoformat.vim
  14. 29
      config/plugins/vista.vim
  15. 331
      doc/doom_nvim.txt
  16. 7
      doc/tags
  17. 30
      docs/contributing.md
  18. 24
      docs/getting_started.md
  19. 258
      docs/modules.md
  20. 47
      doomrc
  21. 11
      init.lua
  22. 7
      init.vim
  23. 2
      install.sh
  24. 102
      lua/configs/lsp.lua
  25. 6
      lua/configs/nvim-colorizer.lua
  26. 29
      lua/configs/nvim-compe.lua
  27. 38
      lua/configs/nvim-gitsigns.lua
  28. 50
      lua/configs/nvim-telescope.lua
  29. 9
      lua/configs/nvim-toggleterm.lua
  30. 203
      lua/configs/statusline.lua
  31. 48
      lua/doom/config/load_plugins.lua
  32. 29
      lua/doom/config/main.lua
  33. 32
      lua/doom/config/ui.lua
  34. 111
      lua/doom/health.lua
  35. 311
      lua/doom/keybindings.lua
  36. 97
      lua/doom/utils/init.lua
  37. 373
      lua/plugins.lua
  38. 10
      lua/plugins/configs/auto-session.lua
  39. 0
      lua/plugins/configs/autopairs.lua
  40. 180
      lua/plugins/configs/lsp.lua
  41. 6
      lua/plugins/configs/nvim-colorizer.lua
  42. 29
      lua/plugins/configs/nvim-compe.lua
  43. 2
      lua/plugins/configs/nvim-focus.lua
  44. 115
      lua/plugins/configs/nvim-format.lua
  45. 67
      lua/plugins/configs/nvim-gitsigns.lua
  46. 34
      lua/plugins/configs/nvim-pears.lua
  47. 46
      lua/plugins/configs/nvim-telescope.lua
  48. 20
      lua/plugins/configs/nvim-toggleterm.lua
  49. 96
      lua/plugins/configs/nvim-tree.lua
  50. 42
      lua/plugins/configs/nvim-zen.lua
  51. 226
      lua/plugins/configs/statusline.lua
  52. 14
      lua/plugins/configs/symbols.lua
  53. 11
      lua/plugins/configs/tree-sitter.lua
  54. 30
      lua/plugins/configs/which-key.lua
  55. 374
      lua/plugins/init.lua

3
.gitignore

@ -1 +1,4 @@
# My temp files
logs/
plugin/
sessions/

102
CHANGELOG.md

@ -0,0 +1,102 @@
# Changelog
All notable changes to this project will be documented in this file.
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).
## [Unreleased]
## [2.0.0] - 2021-04-30
### Added
- Configurations
- `g:doom_autoload_last_session` variable
- `g:doom_terminal_direction` variable
- `g:doom_terminal_width` variable
- `g:doom_terminal_height` variable
- 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
- 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 `<leader>` 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 - 2021-03-30
### Added
- New branch `develop`
### Changed
- Improved installation script
## [1.2.0] - 2021-03-30
### Added
- Configurations
- `g:doom_ts_parsers` variable
- New key binding for toggle terminal
- `doomrc` template with the default options values
- Basic implementation for `:checkhealth` command
- Plugins
- `gitsigns`
- `indentLine`
- `nvim-lspinstall`
- Some new colorschemes
### Changed
- Improved `:DoomUpdate` command
- Some minor changes more under the hood
- Plugins
- `signify` in favor of `gitsigns`
### Fixed
- Squashed some bugs
## 1.1.0 - 2021-03-22
### 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] - 2021-03-19
- Initial stable release
[Unreleased]: https://github.com/NTBBloodbath/doom-nvim/compare/v2.0.0...HEAD
[2.0.0]: https://github.com/NTBBloodbath/doom-nvim/compare/v1.2.0...v2.0.0
[1.2.0]: https://github.com/NTBBloodbath/doom-nvim/compare/v0.2.0...v0.3.0
[1.0.0]: https://github.com/NTBBloodbath/doom-nvim/releases/tag/v1.0.0

70
autoload/doom.vim

@ -5,7 +5,7 @@
"================================================
" Doom Nvim version
let g:doom_version = '1.2.1'
let g:doom_version = '2.0.0'
lockvar g:doom_version
" Force UTF-8 encoding
@ -23,9 +23,13 @@ let g:doom_fmt_on_save = 0
" @default = 0
let g:doom_autosave_sessions = 0
" Autoload sessions
" @default = 0
let g:doom_autoload_last_session = 0
" Preserve last editing position
" @default = 0
let g:doom_preserve_edit_pos = 0
let g:doom_preserve_edit_pos = 1
" Default indent size
" @default = 4
@ -71,15 +75,15 @@ let g:doom_colorscheme = 'doom-one'
" @default = dark
let g:doom_colorscheme_bg = 'dark'
" Checkupdates on start
" Check updates of plugins on start
" @default = 0
let g:doom_check_updates = 0
" Disabled plugins
" @default = ['indentlines']
" @default = ['lazygit', 'minimap', 'restclient']
" example:
" let g:doom_disabled_plugins = ['emmet-vim']
let g:doom_disabled_plugins = ['indentlines']
let g:doom_disabled_plugins = ['lazygit', 'minimap', 'restclient']
" Disabled plugins modules
" @default = ['git', 'lsp', 'web']
@ -89,8 +93,16 @@ let g:doom_disabled_modules = ['git', 'lsp', 'web']
" Install custom plugins
" @default = []
" example:
" let g:doom_custom_plugins = ['andweeb/presence.nvim']
" examples:
" plugins without options:
" let g:doom_custom_plugins = ['andweeb/presence.nvim']
" plugins with options:
" let g:doom_custom_plugins = [
" \ {
" \ 'repo': 'andweeb/presence.nvim',
" \ 'enabled': 1,
" \ }
" \ ]
let g:doom_custom_plugins = []
" Set the parsers for TreeSitter
@ -99,10 +111,32 @@ let g:doom_custom_plugins = []
" let g:doom_ts_parsers = ['python', 'javascript']
let g:doom_ts_parsers = []
"Conceal level
" 0: Disabled
" 1: Enabled
" @default = 0
" Set the Terminal direction
" Available directions:
" - vertical
" - horizontal
" - window
" - float
" @default = 'vertical'
let g:doom_terminal_direction = 'vertical'
" Set the Terminal width
" Applies only to float direction
" @default = 70
let g:doom_terminal_width = 70
" Set the Terminal height
" Applies to all directions except window
" @default = 20
let g:doom_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
let g:doom_conceallevel = 0
" Logging level
@ -121,7 +155,7 @@ if has('nvim')
if has('nvim-0.5')
let g:doom_neovim = 1
else
call doom#logging#message('!!!', 'Doom Nvim requires Neovim 0.5.0, please use the nvim-0.4 branch!', 2)
call doom#logging#message('!!!', 'Doom Nvim requires Neovim 0.5.0', 2)
endif
else
call doom#logging#message('!!!', 'Doom Nvim does not have support for Vim, please use it with Neovim instead!', 2)
@ -156,17 +190,7 @@ endfunction
function! doom#end() abort
call doom#default#loadGlob()
" Test source system-based
call doom#system#grepconfig('config', 'gui.vim', 1)
call doom#system#grepconfig('config', 'keybindings.vim', 1)
" Plugins, configs are loaded only if the plugin is enabled.
if index(g:doom_disabled_plugins, 'vista') == -1
call doom#system#grepconfig('config/plugins', 'vista.vim', 1)
endif
if index(g:doom_disabled_plugins, 'neoformat') == -1
call doom#system#grepconfig('config/plugins', 'neoformat.vim', 1)
endif
call doom#system#grepconfig('config/plugins', 'leader-mapper.vim', 1)
call doom#system#grepconfig('doom', 'keybindings', 1)
" Check updates
call doom#logging#init()

9
autoload/doom/autocmds.vim

@ -14,7 +14,7 @@ function! doom#autocmds#init() abort
augroup END
" Compile new plugins changes at save
autocmd BufWritePost plugins.lua,doomrc PackerCompile
autocmd BufWritePost init.lua,doomrc PackerCompile profile=true
" Disable tabline on Dashboard
autocmd FileType dashboard set showtabline=0 | autocmd WinLeave <buffer> set showtabline=2
@ -30,9 +30,9 @@ function! doom#autocmds#init() abort
endif
" Format on save
" NOTE: Requires neoformat to be enabled!
" NOTE: Requires formatter to be enabled!
if g:doom_fmt_on_save ==# 1
autocmd BufWritePre * undojoin | Neoformat
autocmd BufWritePoist * FormatWrite
endif
" Preserve last editing pos
@ -42,4 +42,7 @@ function! doom#autocmds#init() abort
\ exe "normal! g`\"" |
\ endif
endif
" Set up vim_buffer_previewer in telescope
autocmd User TelescopePreviewerLoaded setlocal wrap
endfunction

2
autoload/doom/config.vim

@ -21,7 +21,7 @@ function! doom#config#loadBFC()
if filereadable(g:doom_root . '/doomrc')
try
execute 'source ' . g:doom_root . '/doomrc'
call doom#logging#message('+', 'Loading the BFC', 2)
call doom#logging#message('+', 'Loading the BFC ...', 2)
catch
call doom#logging#message('!', 'Error while loading the BFC', 1)
endtry

21
autoload/doom/functions.vim

@ -22,14 +22,6 @@ function! doom#functions#get_root() abort
return root
endfunction
" ToggleTerm custom function to avoid having
" line numbers inside the terminal buffer
" because that is not from God.
function! doom#functions#toggle_terminal() abort
execute "ToggleTerm"
set nonumber norelativenumber
endfunction
function! doom#functions#quit_doom(write, force) abort
try
call doom#logging#message('*', 'Checking if the colorscheme was changed...', 2)
@ -55,7 +47,7 @@ function! doom#functions#quit_doom(write, force) abort
" Save current session if enabled
if g:doom_autosave_sessions ==# 1
exec ':SessionSave'
exec ':SaveSession'
endif
if a:write == 1
@ -71,9 +63,12 @@ endfunction
" Create a markdown report to use when a bug occurs,
" useful for debugging issues.
function! doom#functions#createReport() abort
exec ':silent !echo "# doom crash report" >> $HOME/.config/doom-nvim/logs/report.md'
exec ':silent !echo "## Begin log dump" >> $HOME/.config/doom-nvim/logs/report.md'
let time = strftime('%c')
exec ':silent !echo "\# doom crash report\n" >> $HOME/.config/doom-nvim/logs/report.md'
exec ":silent !echo \"Report date: ".time."\" >> $HOME/.config/doom-nvim/logs/report.md"
exec ':silent !echo "\n\#\# Begin log dump" >> $HOME/.config/doom-nvim/logs/report.md'
exec ':silent !echo | cat $HOME/.config/doom-nvim/logs/doom.log >> $HOME/.config/doom-nvim/logs/report.md'
exec ':silent !echo "## End log dump" >> $HOME/.config/doom-nvim/logs/report.md'
exec ':silent echo "Report created at $HOME/.config/doom-nvim/logs/report.md"'
exec ':silent !echo "\#\# End log dump\n" >> $HOME/.config/doom-nvim/logs/report.md'
echo "Report created at ".expand("$HOME/.config/doom-nvim/logs/report.md")
endfunction

2
autoload/doom/logging.vim

@ -13,7 +13,7 @@ function! doom#logging#init()
echo boot_msg
endif
exec ':silent !echo " " >> $HOME/.config/doom-nvim/logs/doom.log'
exec ':silent !echo '.boot_msg.' >> $HOME/.config/doom-nvim/logs/doom.log'
exec ":silent !echo \"".boot_msg."\" >> $HOME/.config/doom-nvim/logs/doom.log"
catch
echo 'Cannot write on_start log message'
exec ':!touch $HOME/.config/doom-nvim/logs/doom.log'

21
autoload/doom/system.vim

@ -8,7 +8,7 @@
scriptencoding utf-8
function! doom#system#whichos()
call doom#logging#message('+', 'Checking OS', 2)
call doom#logging#message('+', 'Checking OS ...', 2)
let g:doom_os = ''
let g:doom_separator = ''
@ -26,28 +26,31 @@ function! doom#system#whichos()
let g:doom_os = 'cygwin'
let g:doom_separator = '\\'
else
echo 'OS not recognized'
call doom#logging#message('!', 'OS not recognized', 1)
endif
call doom#logging#message('+', 'Current OS: '.g:doom_os, 2)
call doom#logging#message('+', 'Current OS : ' . g:doom_os, 2)
endfunction
function! doom#system#grepconfig(folder, filename, source) abort
" Source file or returns the full path
let fullpath = g:doom_root . g:doom_separator . a:folder . g:doom_separator . a:filename
let fullpath = g:doom_root . g:doom_separator . 'lua' . g:doom_separator .a:folder . g:doom_separator . a:filename
let b:luafile = a:folder . '.' . a:filename
if filereadable(fullpath)
if filereadable(fullpath . '.lua')
if a:source ==# 1
try
execute 'source ' fullpath
call doom#logging#message('+', 'Sourced file : '.a:filename, 2)
lua require(vim.b.luafile)
call doom#logging#message('+', 'Sourced file : ' . a:filename, 2)
catch
call doom#logging#message('!', 'Failed sourcing '.a:filename, 1)
call doom#logging#message('!', 'Failed sourcing ' . a:filename . "\n" . v:exception, 1)
endtry
else
call doom#logging#message('+', 'Returned '.a:filename.' path', 2)
call doom#logging#message('+', 'Returned ' . a:filename . ' path', 2)
return fullpath
endif
else
call doom#logging#message('!', 'Trying to source an inexistent file (' . fullpath.'.lua' . ')', 1)
endif
endfunction

2
colors/doom-one.vim

@ -511,7 +511,7 @@ hi! link TSFuncBuiltin FunctionBuiltin
hi! link TSFuncMacro Function
hi! link TSInclude Include
hi! link TSKeyword Keyword
hi! link TSKeywordFunction Function
hi! link TSKeywordFunction Keyword
hi! link TSKeywordOperator Operator
hi! link TSLabel Label
hi! link TSLiteral Constant

31
config/gui.vim

@ -1,31 +0,0 @@
"================================================
" gui.vim - Doom Nvim Gui settings
" Author: NTBBloodbath
" License: MIT
"================================================
" If no colorscheme was established then fallback to defaults
if g:doom_colorscheme !=# ''
try
exec 'set background=' . g:doom_colorscheme_bg
exec 'colorscheme ' . g:doom_colorscheme
catch
call doom#logging#message('!', 'Colorscheme not found', 1)
exec 'colorscheme ' . g:doom_colorscheme
endtry
else
call doom#logging#message('!', 'Forced default colorscheme', 1)
exec 'colorscheme default'
endif
" If guicolors are enabled
if g:doom_enable_guicolors == 1
if has('nvim')
set termguicolors
endif
if exists('+termguicolors')
set termguicolors
elseif exists('+guicolors')
set guicolors
endif
endif

94
config/keybindings.vim

@ -1,94 +0,0 @@
" Define leader key to space
" and call leader mapper
nnoremap <Space> <Nop>
let g:mapleader = " "
"=============================================="
"========================================"
" "
" Custom Key Mappings "
" "
" <leader>b = Buffer Menu "
" <leader>f = File Menu "
" <leader>g = Git Menu "
" <leader>p = Plugin Menu "
" <leader>r = Runner Menu "
" <leader>s = Session Menu "
" <leader>T = Toggle Menu "
" <leader>w = Window Menu "
" "
" TAB = Cycle buffers "
" ESC = Search highlighting off "
" F2 = Toggle Tagbar "
" F3 = Toggle Tree Explorer "
" F4 = Toggle Terminal "
" F5 = Toggle Minimap "
" F6 = Toggle distraction-free "
" F7 = Run dot-http "
" "
"========================================"
"=============================================="
"==========================="
" LSP Keybindings "
"==========================="
" If the LSP group is not disabled or the nvim-compe plugin is not disabled
" then set its mappings.
if index(g:doom_disabled_modules, 'lsp') == -1
" https://github.com/hrsh7th/nvim-compe#mappings
inoremap <silent><expr> <C-Space> compe#complete()
inoremap <silent><expr> <CR> compe#confirm('<CR>')
inoremap <silent><expr> <C-e> compe#close('<C-e>')
inoremap <silent><expr> <C-f> compe#scroll({ 'delta': +4 })
inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 })
endif
" tab to cycle buffers too, why not?
nnoremap <silent><Tab> :bnext<CR>
nnoremap <silent><S-Tab> :bprevious<CR>
" esc to turn off search highlighting
nnoremap <silent><esc> :noh<CR>
" F<N> keybindings
if index(g:doom_disabled_plugins, 'vista') == -1
nnoremap <F2> :Vista!!<CR>
endif
if index(g:doom_disabled_plugins, 'tree') == -1
nnoremap <F3> :NvimTreeToggle<CR>
endif
if index(g:doom_disabled_plugins, 'terminal') == -1
nnoremap <F4> :call doom#functions#toggle_terminal()<CR>
endif
if index(g:doom_disabled_plugins, 'minimap') == -1
nnoremap <F5> :MinimapToggle<CR>
endif
if index(g:doom_disabled_plugins, 'goyo') == -1
nnoremap <F6> :Goyo<CR>
endif
if index(g:doom_disabled_modules, 'web') == -1 &&
\ index(g:doom_disabled_plugins, 'restclient') == -1
nnoremap <F7> :DotHttp<CR>
endif
"====================="
" Disable keys "
"====================="
" disable accidentally pressing ctrl-z and suspending
nnoremap <c-z> <Nop>
" disable ex mode
nnoremap Q <Nop>
" disable recording
nnoremap q <Nop>
" Fast exit from Doom Nvim
nnoremap ZZ :call doom#functions#quit_doom(1,1)<CR>
if index(g:doom_disabled_modules, 'fuzzy') == -1 || index(g:doom_disabled_plugins, 'telescope') == -1
" Set-up vim_buffer_ previewer
autocmd User TelescopePreviewerLoaded setlocal wrap
endif

259
config/plugins/leader-mapper.vim

@ -1,259 +0,0 @@
" Define prefix dictionary
let g:lmap = {}
" LSP Menu
if index(g:doom_disabled_modules, 'lsp') == -1 && index(g:doom_disabled_plugins, 'compe') == -1
let g:lmap.l = {'name': 'LSP Menu'}
" Show type definition
nnoremap <leader>lD <cmd>lua vim.lsp.buf.type_definition()<CR>
let g:lmap.l.D = 'Show type definition'
" Show line diagnostics
nnoremap <leader>le <cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>
let g:lmap.l.e = 'Show line diagnostics'
" Diagnostics into location list
nnoremap <leader>lq <cmd>lua vim.lsp.diagnostic.set_loclist()<CR>
let g:lmap.l.q = 'Diagnostics into location list'
endif
" Git Menu
if index(g:doom_disabled_modules, 'git') == -1 && index(g:doom_disabled_plugins, 'lazygit') == -1 ||
\ index(g:doom_disabled_modules, 'git') == -1 && index(g:doom_disabled_plugins, 'toggleterm') == -1 ||
\ index(g:doom_disabled_modules, 'git') == -1 && index(g:doom_disabled_plugins, 'gitsigns') == -1
let g:lmap.g = {'name': 'Git Menu'}
if index(g:doom_disabled_plugins, 'lazygit') == -1
" Open LazyGit
nnoremap <leader>go :LazyGit<CR>
let g:lmap.g.o = 'Open LazyGit'
endif
if index(g:doom_disabled_plugins, 'toggleterm') == -1
" Pull
nnoremap <leader>gP :TermExec cmd='git pull'<CR>
let g:lmap.g.P = 'Pull'
" Push
nnoremap <leader>gp :TermExec cmd='git push'<CR>
let g:lmap.g.p = 'Push'
" Status
nnoremap <leader>gs :TermExec cmd='git status'<CR>
let g:lmap.g.s = 'Status'
endif
if index(g:doom_disabled_plugins, 'gitsigns') == -1
" Stage hunk
let g:lmap.g.S = 'Stage hunk'
" Undo stage hunk
let g:lmap.g.u = 'Undo stage hunk'
" Reset hunk
let g:lmap.g.r = 'Reset hunk'
" Reset buffer
let g:lmap.g.R = 'Reset buffer'
" Preview hunk
let g:lmap.g.h = 'Preview hunk'
" Blame line
let g:lmap.g.b = 'Blame line'
endif
endif
" Plugin Menu
let g:lmap.p = {'name': 'Plugin Menu'}
" Clean disabled or unused plugins
nnoremap <leader>pc :PackerClean<CR>
let g:lmap.p.c = 'Clean disabled or unused plugins'
" Install missing plugins
nnoremap <leader>pi :PackerInstall<CR>
let g:lmap.p.i = 'Install missing plugins'
" Performs PackerClean and then PackerUpdate
nnoremap <leader>ps :PackerSync<CR>
let g:lmap.p.s = 'Performs PackerClean and then PackerUpdate'
" Update your plugins
nnoremap <leader>pu :PackerUpdate<CR>
let g:lmap.p.u = 'Update your plugins'
" Buffer Menu
let g:lmap.b = {'name': 'Buffer Menu'}
" Go to buffer 1
nnoremap <leader>b1 :BufferGoto 1<CR>
let g:lmap.b.1 = 'Buffer 1'
" Go to buffer 2
nnoremap <leader>b2 :BufferGoto 2<CR>
let g:lmap.b.2 = 'Buffer 2'
" Go to buffer 3
nnoremap <leader>b3 :BufferGoto 3<CR>
let g:lmap.b.3 = 'Buffer 3'
" Go to buffer 4
nnoremap <leader>b4 :BufferGoto 4<CR>
let g:lmap.b.4 = 'Buffer 4'
" Go to buffer 5
nnoremap <leader>b5 :BufferGoto 5<CR>
let g:lmap.b.5 = 'Buffer 5'
" Go to buffer 6
nnoremap <leader>b6 :BufferGoto 6<CR>
let g:lmap.b.6 = 'Buffer 6'
" Go to buffer 7
nnoremap <leader>b7 :BufferGoto 7<CR>
let g:lmap.b.7 = 'Buffer 7'
" Go to buffer 8
nnoremap <leader>b8 :BufferGoto 8<CR>
let g:lmap.b.8 = 'Buffer 8'
" Go to last buffer
nnoremap <leader>b9 :BufferLast<CR>
let g:lmap.b.9 = 'Last buffer'
" Close current buffer
nnoremap <leader>bc :BufferClose<CR>
let g:lmap.b.c = 'Close buffer'
" Format buffer
nnoremap <leader>bf :Neoformat<CR>
let g:lmap.b.f = 'Format buffer'
" Next buffer
nnoremap <leader>bn :BufferNext<CR>
let g:lmap.b.n = 'Next buffer'
" Pick buffer
nnoremap <leader>bP :BufferPick<CR>
let g:lmap.b.P = 'Pick buffer'
" Previous buffer
nnoremap <leader>bp :BufferPrevious<CR>
let g:lmap.b.p = 'Previous buffer'
" Order Buffer Menu
let g:lmap.o = {'name': 'Order Menu'}
" Sort by directory
nnoremap <leader>od :BufferOrderByDirectory<CR>
let g:lmap.o.d = 'Sort by directory'
" Sort by language
nnoremap <leader>ol :BufferOrderByLanguage<CR>
let g:lmap.o.l = 'Sort by language'
" Re-order buffer to next
nnoremap <leader>on :BufferMoveNext<CR>
let g:lmap.o.n = 'Re-order buffer to next'
" Re-order buffer to previous
nnoremap <leader>op :BufferMovePrevious<CR>
let g:lmap.o.p = 'Re-order buffer to previous'
" File Menu
let g:lmap.f = {'name': 'File Menu'}
" Edit Neovim configuration
nnoremap <leader>fc :e $MYVIMRC<CR>
let g:lmap.f.c = 'Edit Neovim configuration'
" Create a new unnamed buffer
nnoremap <leader>fn :new<CR>
let g:lmap.f.n = 'Create a new unnamed buffer'
if index(g:doom_disabled_plugins, 'telescope') == -1
" Bookmarks
nnoremap <leader>fb :Telescope marks<CR>
let g:lmap.f.b = 'Bookmarks'
" Find file
nnoremap <leader>ff :Telescope find_files<CR>
let g:lmap.f.f = 'Find file'
" Find word
nnoremap <leader>fg :Telescope live_grep<CR>
let g:lmap.f.g = 'Find word'
" Help tags
nnoremap <leader>ft :Telescope help_tags<CR>
let g:lmap.f.t = 'Help Tags'
" Override existing telescope <leader>fh mapping
autocmd VimEnter * noremap <leader>fh :Telescope oldfiles<CR>
" Recently opened files
nnoremap <leader>fh :Telescope oldfiles<CR>
let g:lmap.f.h = 'Recently opened files'
endif
if index(g:doom_disabled_plugins, 'suda') == -1
" Write file with sudo permissions (For unwritable files)
nnoremap <leader>fw :SudaWrite<CR>
let g:lmap.f.w = 'Write file with sudo permissions (For unwritable files)'
" Re-open file with sudo permissions (For unreadable files only!)
nnoremap <leader>fr :SudaRead<CR>
let g:lmap.f.r = 'Re-open file with sudo permissions (For unreadable files only!)'
endif
" Window Menu
let g:lmap.w = {'name': 'Window Menu'}
" Close all other windows
nnoremap <leader>wC :only<CR>
let g:lmap.w.C = 'Close all other windows'
" Close current window
nnoremap <leader>wc :close<CR>
let g:lmap.w.c = 'Close current window'
" Split horizontally
nnoremap <leader>wh :split<CR>
let g:lmap.w.h = 'Split horizontally'
" Split vertically
nnoremap <leader>wv :vsplit<CR>
let g:lmap.w.v = 'Split vertically'
" Runner Menu
if index(g:doom_disabled_modules, 'web') == -1
let g:lmap.r = {'name': 'Runner Menu'}
if index(g:doom_disabled_plugins, 'dot-http') == -1
" Run dot-http on the line that the cursor is currently on
nnoremap <leader>rh :DotHttp<CR>
let g:lmap.r.h = 'Run dot-http on the line that the cursor is currently on'
endif
endif
" Session Menu
let g:lmap.s = {'name': 'Session Menu'}
" Save session
nnoremap <leader>ss :<C-u>SessionSave<CR>
let g:lmap.s.s = 'Save session'
" Load session
nnoremap <leader>sl :<C-u>SessionLoad<CR>
let g:lmap.s.l = 'Load session'
" Doom Menu
let g:lmap.d = {'name': 'Doom Menu'}
" Open your Doom Nvim configurations
nnoremap <leader>dc :e ~/.config/doom-nvim/doomrc<CR>
let g:lmap.d.c = 'Edit your Doom Nvim configuration'
" Open Doom Nvim docs
nnoremap <leader>dd :help doom_nvim<CR>
let g:lmap.d.d = 'Open Doom Nvim Documentation'
" Check Doom Nvim Updates and update if available
nnoremap <leader>du :DoomUpdate<CR>
let g:lmap.d.u = 'Check Doom Nvim Updates'
" ToggleNumbers function,
" toggle between relative numbers and absolute numbers
" depending on the value of g:doom_relative_num
function ToggleNumbers()
if g:doom_relative_num ==# 1
set number! relativenumber!
else
set number!
endif
endfunction
" Toggle Menu
let g:lmap.t = {'name': 'Toggler Menu'}
" Toggle Line Numbers
nnoremap <leader>tn :call ToggleNumbers()<CR>
let g:lmap.t.n = 'Toggle Line Numbers'
" Open start screen
nnoremap <leader>ts :Dashboard<CR>
let g:lmap.t.s = 'Open start screen'
" Change colorscheme
nnoremap <leader>tc :DashboardChangeColorscheme<CR>
let g:lmap.t.c = 'Change colorscheme'
if index(g:doom_disabled_plugins, 'tree') == -1
" Toggle Tree Explorer
nnoremap <leader>te :NvimTreeToggle<CR>
let g:lmap.t.e = 'Toggle Tree Explorer'
endif
if index(g:doom_disabled_plugins, 'minimap') == -1
" Toggle Minimap
nnoremap <leader>tm :MinimapToggle<CR>
let g:lmap.t.m = 'Toggle Minimap'
endif
if index(g:doom_disabled_plugins, 'vista') == -1
" Toggle Tags view
nnoremap <leader>tT :Vista!!<CR>
let g:lmap.t.T = 'Toggle Tags view'
endif
if index(g:doom_disabled_plugins, 'toggleterm') == -1
" Open a new terminal
nnoremap <leader>tt :call doom#functions#toggle_terminal()<CR>
let g:lmap.t.t = 'Toggle terminal'
endif
" Display menus with a `+` in-front of the description (à la emacs-which-key).
let g:leaderGuide_display_plus_menus = 1
" Register the dictionary
call leaderGuide#register_prefix_descriptions('<Space>', 'g:lmap')
nnoremap <silent> <leader> :<c-u>LeaderGuide '<Space>'<CR>
vnoremap <silent> <leader> :<c-u>LeaderGuideVisual '<Space>'<CR>

12
config/plugins/neoformat.vim

@ -1,12 +0,0 @@
" - Enable basic formatting when a ft is not found
" Enable alignment
let g:neoformat_basic_format_align = 1
" Enable tab to spaces conversion
let g:neoformat_basic_format_retab = 1
" Enable trimming of trailing whitespace
let g:neoformat_basic_format_trim = 1
" Run all the formatters if the defined below fails
let g:neoformat_run_all_formatters = 1
" Only message when there is an error
let g:neoformat_only_msg_on_error = 1

29
config/plugins/vista.vim

@ -1,29 +0,0 @@
" Position to open the vista sidebar only
if g:doom_tagbar_left ==# 1
let g:vista_sidebar_position = 'vertical topleft'
else
let g:vista_sidebar_position = 'vertical botright'
endif
" Sidebar width
let g:vista_sidebar_width = g:doom_sidebar_width
" Executive used when opening vista sidebar without specifying it.
let g:vista_default_executive = 'nvim_lsp'
" Set how to show the detailed information of the current cursor symbol
let g:vista_echo_cursor_strategy = 'both'
" Close the vista window automatically when you jump to a symbol
let g:vista_close_on_jump = 1
" Ensure you have installed some decent font to show these pretty symbols,
" then you can enable icon for the kind.
let g:vista#renderer#enable_icon = 1
" The default icons can't be suitable for all the filetypes, you can extend it
" as you wish.
let g:vista#renderer#icons = {
\ "function": "\uf794",
\ "variable": "\uf71b",
\}

331
doc/doom_nvim.txt

@ -38,20 +38,20 @@
7. Modules..............................|doom_nvim_configuration_modules|
1. Enabling modules..........|doom_nvim_configuration_modules_enabling|
2. Disabling modules........|doom_nvim_configuration_modules_disabling|
8. LSP......................................|doom_nvim_configuration_lsp|
8. Custom Plugins................|doom_nvim_configuration_custom_plugins|
9. LSP......................................|doom_nvim_configuration_lsp|
4. Commands............................................|doom_nvim_commands|
1. Keybindings...........................|doom_nvim_commands_keybindings|
5. Functions..........................................|doom_nvim_functions|
6. Usage..................................................|doom_nvim_usage|
5. 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|
6. Known issues..........................................|doom_nvim_issues|
7. FAQ......................................................|doom_nvim_faq|
8. Hacking Doom Nvim....................................|doom_nvim_hacking|
1. Autoload..................................|doom_nvim_hacking_autoload|
10. Acknowledgements...........................|doom_nvim_acknowledgements|
11. License.............................................|doom_nvim_license|
12. Contributing...................................|doom_nvim_contributing|
13. Changelog.........................................|doom_nvim_changelog|
9. Acknowledgements...........................|doom_nvim_acknowledgements|
10. License.............................................|doom_nvim_license|
11. Contributing...................................|doom_nvim_contributing|
12. Changelog.........................................|doom_nvim_changelog|
==============================================================================
@ -74,7 +74,7 @@ OPTIONS *doom_nvim_options*
Doom Nvim configuration files resides in the `$HOME/.config/doom-nvim/config`
directory. Global variables for Doom Nvim resides in
`$HOME/.doom-nvim/autoload/doom.vim`.
`$HOME/.config/doom-nvim/autoload/doom.vim`.
All the options available in the `doom.vim` file are global variables.
They all start with `g:doom_` followed by a description of ther nature:
@ -95,9 +95,15 @@ default value = 0
default value = 0
0 : Disable session autosave
1 : Enable session autosave
This option will also autoload saved sessions
`g:doom_preserve_edit_pos`
`g:doom_autoload_last_session`
default value = 0
0 : Disable autoload of last unsaved session
1 : Enable autoload of last unsaved session
`g:doom_preserve_edit_pos`
default value = 1
0 : Disable preservation of last editing position
1 : Enable preservation of last editing position
@ -154,7 +160,7 @@ default value = 0
Check updates of plugins on start
`g:doom_disabled_plugins`
default value = []
default value = ['lazygit', 'minimap', 'restclient']
List of user disabled plugins
`g:doom_disabled_modules`
@ -169,8 +175,27 @@ List of user custom plugins
Set the parsers for TreeSitter
default value = []
`g:doom_terminal_direction`
default value = 'vertical'
Set the Terminal direction
Available directions:
- vertical
- horizontal
- window
- float
`g:doom_terminal_width`
default value = 70
Set the Terminal width
Applies only to float direction
`g:doom_terminal_height`
default value = 20
Set the Terminal height
Applies to all directions except window
`g:doom_conceallevel`
default value = 1
default value = 0
Set Neovim conceal level
0 : Disable indentline and show all
1 : Conceal some functions and show indentlines
@ -250,7 +275,7 @@ following layout:
'A' : The tagbar (Plugin: vista.vim)
'A' : The tagbar (Plugin: SymbolsOutline)
'B' : The main buffer
'C' : The terminal (Plugin: nvim-toggleterm.lua)
'D' : The minimap (Plugin: minimap.vim)
@ -290,11 +315,13 @@ TAGBAR *doom_nvim_configuration_layout_tagbar*
Tagbar 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
`liuchengxu/vista.vim`. It can be toggled by performing the following commands:
<Space>tT for `Tagbar`
`simrat39/symbols-outline.nvim`. It can be toggled by performing the following
commands:
<Space>tS for `Tagbar`
<F2> for `Tagbar`
See https://github.com/liuchengxu/vista.vim for more information.
See https://github.com/simrat39/symbols-outline.nvim for more information.
==============================================================================
@ -313,6 +340,7 @@ 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>tt for `Terminal`
<F4> for `Terminal`
@ -325,12 +353,12 @@ 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:
- Essentials (package manager, utilities for using Lua inside Neovim)
- Essentials (package manager, TreeSitter and utilities for using
Lua inside Neovim)
- UI (everything related to UI)
- Fuzzy (telescope.nvim, fuzzy searching)
- Git (everything related to Git)
- LSP (for using Language Server Protocols by using the built-in LSP)
- Files (utilities like formatter, commenter, improvements, etc)
- Files (utilities like formatter, commenter, etc)
- Web (for web development)
You can see in a more detailed view the modules and its plugins at
@ -345,7 +373,7 @@ To enable a module, you can use the `g:doom_disabled_modules` variable on your
Example:
To enable all modules except web, just put only 'web' in the disabled
modules array and then, reboot Neovim and do `:PackerSync`.
modules array and then reboot Neovim and do `:PackerSync`.
let g:doom_disabled_modules = ['web']
@ -358,11 +386,40 @@ your `doomrc`.
Example:
To disable only the web module, just put only 'web' in the disabled
modules array and then, reboot Neovim and do `:PackerSync`.
modules array and then reboot Neovim and do `:PackerSync`.
let g:doom_disabled_modules = ['web']
==============================================================================
CUSTOM PLUGINS *doom_nvim_configuration_custom_plugins*
To use your own plugins in Doom Nvim you can use the `g:doom_custom_plugins`
variable on your `doomrc`.
To add plugins without extra configurations (e.g., if a plugin does not depends
on other plugins), you can simply set it as follow:
let g:doom_custom_plugins = ['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:
let g:doom_custom_plugins = [
\ {
\ 'repo': 'andweeb/presence.nvim',
\ 'enabled': 1,
\ 'requires': ['foo', 'bar']
\ }
\ ]
As you can see, the second way depends on a structure to work.
repo: the repository where the plugin resides
enabled: if the plugin should be enabled, not required (true by default)
requires: plugin dependencies, not required
==============================================================================
LSP *doom_nvim_configuration_lsp*
@ -429,26 +486,33 @@ In Doom Nvim, we make use of the <Space> keystroke as the map leader.
| <d>oom
| | <c> Edit your Doom Nvim configuration
| | <d> Open Doom Nvim docs
| | <r> Create crash reports, useful for debugging
| | <u> Check Doom Nvim updates
| <f>ile
| | <b> Bookmarks
| | <c> Edit your Neovim Configuration
| | <f> Find file
| | <g> Find word
| | <W> Find word
| | <h> Recently opened files
| | <n> New unnamed buffer
| | <r> Re-open an unreadable file with sudo permissions
| | <t> Help tags
| | <w> Write an unwritable file with sudo permissions
| <g>it
| | <b> Blame line
| | <h> Preview hunk
| | <R> Reset buffer
| | <r> Reset hunk
| | <o> Open LazyGit
| | <p> Push
| | <P> Pull
| | <p> Push
| | <S> Stage hunk
| | <s> Status
| | <u> Undo stage hunk
| <l>sp
| | <D> Show type definition
| | <e> Show line diagnostics
| | <q> Diagnostics into location list
| | <d> Show type definition
| | <l> Show line diagnostics
| | <L> Diagnostics into location list
| <o>rder
| | <d> Sort by directory
| | <l> Sort by language
@ -457,21 +521,22 @@ In Doom Nvim, we make use of the <Space> keystroke as the map leader.
| <p>lugin
| | <c> Clean unused plugins
| | <i> Install missing plugins
| | <p> Profile the time taken loading your plugins
| | <s> Sync plugins (Clean and Update)
| | <u> Update plugins
| <r>unner
| | <h> Run rest client in the current cursor line
| | <h> Run restclient in the current cursor line
| <s>ession
| | <s> Save session
| | <l> Load session
| | <l> Session switcher/selector
| | <s> Save current session
| | <r> Restore previously saved session
| <t>oggler
| | <c> Change colorscheme
| | <e> Toggle Tree Explorer
| | <m> Toggle Minimap
| | <n> Toggle Line Numbers
| | <S> Toggle Symbols view
| | <s> Toggle Start Screen
| | <t> Toggle Terminal
| | <T> Toggle Tagbar
| <w>indow
| | <c> Close current window
| | <C> Close all other windows
@ -489,9 +554,9 @@ your life easier!
| <F3> | Toggle Tree Explorer
| <F4> | Toggle Terminal
| <F5> | Toggle Minimap
| <F6> | Toggle distraction-free mode
| <F7> | Run rest client
| <Z><Z> | Fast exit from Doom Nvim
| <F6> | ToggleZen mode
| <F7> | Run restclient
| <Z><Z> | Fast exit from Doom Nvim (also dumps `:messages` to logs)
| <g><c> | Comment selected block (`VISUAL` mode)
You can modify the default keybindings by modifying the following files:
@ -502,14 +567,6 @@ You can modify the default keybindings by modifying the following files:
You can also make your own keybindings by editing your `doomrc` file.
==============================================================================
FUNCTIONS *doom_nvim_functions*
`ToggleNumbers`: Toggles the line numbers, if `g:doom_relative_num` is `1`
then it will toggle the relative numbers, otherwise, it will toggle the
absolute numbers.
==============================================================================
USAGE *doom_nvim_usage*
@ -535,19 +592,16 @@ Use `h` go to left, `j` to go down, `k` to go up, `l` to go right.
j
v
See `Tutor` to know how to use Vim and its keybindings
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 corresponding to the buffer you want to select (`1-9`).
and then press the key corresponding to the buffer you want to select (`1-9`)
or press `<TAB>` to cycle buffers.
==============================================================================
KNOWN ISSUES *doom_nvim_issues*
- When using the distraction-free mode, it will be still displaying the
statusbar, at the moment cannot be fixed unless you use other statusline.
See |doom_nvim_configuration_modules_disabling| for more information.
- 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
@ -578,40 +632,40 @@ Doom Nvim aims to be hackable to suit everyone's needs. Therefore
This is the structure of Doom Nvim:
 ./
├──  autoload/ # Files loaded at launch
│ ├──  color.vim # Color utilities, required by doom-one.vim
│ ├──  doom/ # Doom Nvim core
│ │ ├──  autocmds.vim # Doom Nvim autocommands
│ │ ├──  config.vim # Doom Nvim custom config file loader
│ │ ├──  default.vim # Doom Nvim default configs
│ │ ├──  functions.vim # Doom Nvim core functions
│ │ ├──  health.vim # Doom Nvim health
│ │ ├──  logging.vim # Doom Nvim logging manager
│ └──  system.vim # Doom Nvim system detection (early stage)
│ └──  doom.vim # Config file for various globals
├──  colors/ # Doom Nvim colorschemes directory
│ └──  doom-one.vim # `romgrk` doom colorscheme ported to Nvim (`default`)
├──  config/ # Configuration files for Doom Nvim
├──  gui.vim # Doom Nvim GUI options
│ ├──  keybindings.vim # Doom Nvim keybindings
│ ├──  main.vim # Init file, loads packer.nvim and plugins
│ └──  plugins/ # Vimscript plugins configs directory
│ ├──  leader....vim # leader-mapper keybindings
│ ├──  neoformat.vim # neoformat configs
│ └──  vista.vim # vista.vim configs
├──  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
├──  init.vim # init.vim file
├──  install.sh # Doom Nvim manager
├──  LICENSE # Doom Nvim License
├──  logs/ # Location of Doom Nvim log file
├──  lua/ # Location of Lua plugins, including packer.nvim
├──  configs/ # Location of Lua plugins configurations
└──  plugins.lua # Plugin manager configurations
└──  sessions/ # Location of Vim workspaces
 .
├──  autoload # Files loaded at launch
│ ├──  color.vim # Color utilities, required by `doom-one.vim`
│ ├──  doom # Doom Nvim core
│ │ ├──  autocmds.vim # Doom Nvim autocommands
│ │ ├──  config.vim # Doom Nvim custom config file loader
│ │ ├──  default.vim # Doom Nvim default configs
│ │ ├──  functions.vim # Doom Nvim core functions
│ │ ├──  logging.vim # Doom Nvim logging manager
│ │ └──  system.vim # Doom Nvim system detection (early stage)
├──  doom.vim # Config file for various globals
│ └──  health # Doom Nvim health add-ons for `:checkhealth`
├──  colors # Doom Nvim 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
│ │ ├──  config # Main configurations of Doom Nvim
│ │ ├──  health.lua # Doom Nvim health checking, complement for health dir
│ │ ├──  keybindings.lua # Doom Nvim default keybindings
│ │ └──  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
if it is not present on the system. It allows a fine control over the core
@ -684,35 +738,88 @@ CONTRIBUTING *doom_nvim_contributing*
==============================================================================
CHANGELOG *doom_nvim_changelog*
Doom Nvim follows the semantic versioning and reached its stable version in
version 1.0.0
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.0.0 (in development)
- 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 `<leader>` 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
- Improved installation script
- New branch `develop`
- Added
- New branch `develop`
- Changed
- Improved installation script
- 1.2.0
- Added `g:doom_ts_parsers`,
see |doom_nvim_options|
- Added new keybinding for toggle terminal,
see |doom_nvim_commands_keybindings|
- Added a basic implementation for `:checkhealth` command
- Added a `doomrc` template with the default options values
- Improved `:DoomUpdate` command
- Added new plugins
- `gitsigns`
- `indentLine`
- `nvim-lspinstall`
- some new colorschemes, see |doom_colorscheme|
- Removed plugins
- `signify` in favor of `gitsigns`
- Squashed some bugs
- Some minor changes more under the hood
- 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|
- Added `:DoomUpdate` command,
see |doom_nvim_commands|
- Added `g:doom_autosave_sessions`,
see |doom_nvim_options|
- 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
- Initial stable release

7
doc/tags

@ -5,15 +5,20 @@ doom_nvim_changelog doom_nvim.txt /*doom_nvim_changelog*
doom_nvim_commands doom_nvim.txt /*doom_nvim_commands*
doom_nvim_commands_keybindings doom_nvim.txt /*doom_nvim_commands_keybindings*
doom_nvim_configuration doom_nvim.txt /*doom_nvim_configuration*
doom_nvim_configuration_custom_plugins doom_nvim.txt /*doom_nvim_configuration_custom_plugins*
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_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*
doom_nvim_configuration_modules_disabling doom_nvim.txt /*doom_nvim_configuration_modules_disabling*
doom_nvim_configuration_modules_enabling doom_nvim.txt /*doom_nvim_configuration_modules_enabling*
doom_nvim_contents doom_nvim.txt /*doom_nvim_contents*
doom_nvim_contributing doom_nvim.txt /*doom_nvim_contributing*
doom_nvim_faq doom_nvim.txt /*doom_nvim_faq*
doom_nvim_functions doom_nvim.txt /*doom_nvim_functions*
doom_nvim_hacking doom_nvim.txt /*doom_nvim_hacking*
doom_nvim_hacking_autoload doom_nvim.txt /*doom_nvim_hacking_autoload*
doom_nvim_intro doom_nvim.txt /*doom_nvim_intro*

30
docs/contributing.md

@ -8,7 +8,7 @@ You are welcome to contribute with anything to improve Doom Nvim, but please
look at [contributing code](#contributing-code) to know better how to contribute
and which code style you should use :heart:
> **Working on your first Pull Request?** You can learn how from this *free* series
> **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
@ -42,15 +42,15 @@ and which code style you should use :heart:
## Acquire a backtrace from errors
All the errors ocurred in Doom Nvim are saved into a `doom.log` file 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 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].
> **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
@ -61,6 +61,7 @@ thus reach a solution more quickly.
## 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`)
- Which branch of Doom Nvim are you using
@ -87,20 +88,31 @@ Doom Nvim follows some code style rules like ones the mentioned below:
- 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`.
- [stylua] is used to format lua files with the following configuration:
```toml
column_width = 80
line_endings = "Unix"
indent_type = "Tabs"
indent_width = 4
quote_style = "AutoPreferSingle"
```
### Commits & PRs
- Target `develop-nightly` instead of `main`.
- Target `develop` instead of `main`.
the only exception are hotfixes!
### Keybind conventions
- The keybindings should be declared in [config/keybindings](../config/keybindings.vim),
except when they are keybindings of the [leader-mapper](../config/plugins/leader-mapper.vim)
or keybindings of [Lua plugins](../lua/configs).
- The keybindings should be declared in [config/keybindings](../lua/doom/keybindings.lua),
except when they are keybindings of [Lua plugins](../lua/plugins/configs).
## 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
your pull request :)
[stylua]: https://github.com/JohnnyMorganz/StyLua

24
docs/getting_started.md

@ -221,7 +221,7 @@ Read on to learn how to use this system to install your own plugins.
### Installing plugins
To install a custom package, add it to `g:doom_custom_plugins` variable into your
To install a custom plugin, add it to `g:doom_custom_plugins` variable into your
`doomrc`.
```vim
@ -229,6 +229,19 @@ To install a custom package, add it to `g:doom_custom_plugins` variable into you
let g:doom_custom_plugins = ['plugin_author/plugin_repo']
```
You can also use other method if the plugin depends on other plugins.
```vim
let g:doom_custom_plugins = [
\ 'plugin_author/plugin_repo',
\ {
\ 'repo': 'plugin_author/second_plugin_repo',
\ 'enabled': 1, " not required, 1 by default
\ 'requires': ['foo', 'bar'] " not required if the plugin does not have dependencies
\ },
\ ]
```
> **NOTES:**
>
> 1. Do not forget to run `:PackerInstall` to install your new plugins.
@ -265,8 +278,7 @@ You can change Doom's default settings by tweaking your `doomrc`, please see
Do you want to change some configurations of some modules?
Go to `lua/configs` dir and you will find the configurations for the Lua plugins,
or go to `config/plugins` dir to change the Vimscript plugins configurations.
Go to `lua/plugins/configs` dir and you will find the configurations for the plugins.
### Configuring LSP
@ -282,8 +294,8 @@ You can see a list of currently supported languages at [bundled installers](http
## Binding keys
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/keybindings.lua` - General and SPC keybindings
- `lua/plugins/configs` - lua plugins keybindings
You can also make your own keybindings by editing your `doomrc` file.

258
docs/modules.md

@ -1,12 +1,21 @@
# Doom Nvim Modules
# Table of Contents
- [Introduction](#introduction)
- [Tweaking Doom Nvim Modules](#tweaking-doom-nvim-modules)
- [List of modules](#list-of-modules)
- [Enabling modules](#enabling-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 modules](#disabling-modules)
- [Disabling module plugins](#disabling-module-plugins)
# Introduction
@ -24,98 +33,108 @@ You can easily tweak Doom Nvim Modules by tweaking your doomrc
First of all, we must know which modules we can enable and disable,
including their plugins individually.
- Essentials
- [x] Enabled by default
- [ ] Can be disabled
- Plugins inside
- [ ] packer.nvim (Plugins manager)
- [ ] vimpeccable (Helpers for Lua configs)
- [ ] vim-polyglot (Support for languages)
- UI
- [x] Enabled by default
- [ ] Can be disabled
- Plugins inside
- [ ] dashboard-nvim (Start screen)
- [ ] colorschemes (obviously, colorschemes)
- [x] nvim-tree (File tree)
- Use `tree` to disable it
- [x] galaxyline.nvim (Statusline)
- Use `statusline` to disable it
- [x] barbar.nvim (Tabline)
- Use `tabline` to disable it
- [x] focus.nvim (better splits)
- Use `focus` to disable it
- [x] nvim-toggleterm (better terminal)
- Use `terminal` to disable it
- [x] vista.vim (viewer for LSP symbols and tags)
- Use `vista` to disable it
- [x] minimap.vim (Minimap)
- Use `minimap` to disable it
- **Depends on** [wfxr/code-minimap](htps://github.com/wfxr/code-minimap) **to work!**
- [ ] vim-leader-guide (Menu like Emacs's guide-key)
- [x] goyo.vim (Distraction free environment)
- Use `goyo` to disable it
- Fuzzy Search
- [x] Enabled by default
- [x] Can be disabled
- Use `fuzzy` to disable the entire module
- Plugins inside
- [x] telescope.nvim (Fuzzy search & more)
- Use `telescope` to disable it
- **NOTE:** dashboard-nvim depends on telescope to do some things, like shortcuts!
- Git
- [ ] Enabled by default
- [x] Can be disabled
- Use `git` to disable the entire module
- Plugins inside
- [x] vim-signify (Show a diff using Vim its sign column)
- Use `signify` to disable it
- [x] lazygit (Call 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 (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)
- 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 (Write/Read files without having to use `sudo nvim`, still requires user password!)
- Use `suda` to disable it
- [x] neoformat (File formatting)
- Use `neoformat` to disable it
- [x] nvim-autopairs (Autopairs)
- Use `autopairs` to disable it
- [x] indent-blankline (Indent Lines Guide)
- Use `indentlines` to disable it
- [x] editorconfig (EditorConfig support)
- Use `editorconfig` to disable it
- [x] treesitter (Better syntax highlight & more)
- Use `treesitter` to disable it
- [x] kommentary (Comments plugin)
- 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 (Fastest colorizer without external dependencies)
- 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 plugin for Vim)
- Use `emmet` to disable it
## Enabling modules
### Essentials
- [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.
### UI
- [x] Enabled by default
- [ ] Can be disabled
- Plugins inside
- [ ] [dashboard-nvim] - Vim dashboard.
- [ ] colorschemes - Obviously, colorschemes.
- [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] [focus.nvim] - Auto-Focusing Splits/Windows for Neovim written in Lua
- Use `focus` 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
## Managing modules
### Enabling modules
To enable a module, you can use the `g:doom_disabled_modules` variable on your
`doomrc`.
@ -123,7 +142,7 @@ To enable a module, you can use the `g:doom_disabled_modules` variable on your
```vim
" 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']
let g:doom_disabled_modules = ['web']
```
@ -135,7 +154,7 @@ All the module plugins will be enabled by default unless the entire module is di
> If you want to use custom plugins, please refer to
> [Installing plugins](./getting_started.md#installing-plugins).
## Disabling modules
### Disabling modules
To disable a module, you can use the `g:doom_disabled_modules` variable
on your `doomrc`.
@ -143,7 +162,7 @@ on your `doomrc`.
```vim
" 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']
let g:doom_disabled_modules = ['web']
```
@ -157,3 +176,48 @@ on your `doomrc`.
" @default = []
let g:doom_disabled_plugins = ['emmet']
```
<!-- Essentials -->
[packer.nvim]: https://github.com/wbthomason/packer.nvim
[vimpeccable]: https://github.com/svermeulen/vimpeccable
[treesitter]: https://github.com/nvim-treesitter/nvim-treesitter
<!-- UI -->
[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
[focus.nvim]: https://github.com/beauwilliams/focus.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
<!-- Fuzzy -->
[telescope.nvim]: https://github.com/nvim-telescope/telescope.nvim
<!-- Git -->
[gitsigns.nvim]: https://github.com/lewis6991/gitsigns.nvim
[lazygit]: https://github.com/kdheepak/lazygit.nvim
<!-- LSP -->
[nvim-lspconfig]: https://github.com/neovim/nvim-lspconfig
[nvim-compe]: <!-- Files -->
[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
[kommentary]: https://github.com/b3nj5m1n/kommentary
<!-- Web -->
[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

47
doomrc

@ -15,17 +15,22 @@ let g:doom_autosave = 0
" @default = 0
let g:doom_fmt_on_save = 0
" Autosave sessions
" Autosave and autoload saved sessions
" 0 : Disable session autosave
" 1 : Enable session autosave
" @default = 0
let g:doom_autosave_sessions = 0
" Autoload last unsaved session
" 0 : Disable last session autoload
" 1 : Enable last session autosave
let g:doom_autoload_last_session = 0
" Preserve last editing position
" 0 : Disable preservation of last editing position
" 1 : Enable preservation of last editing position
" @default = 0
let g:doom_preserve_edit_pos = 0
let g:doom_preserve_edit_pos = 1
" Default indent size
" @default = 4
@ -80,15 +85,15 @@ let g:doom_colorscheme = 'doom-one'
" @default = dark
let g:doom_colorscheme_bg = 'dark'
" Checkupdates on start
" Check updates on start
" @default = 0
let g:doom_check_updates = 0
" Disabled plugins
" @default = []
" @default = ['lazygit', 'minimap', 'restclient']
" example:
" let g:doom_disabled_plugins = ['emmet-vim']
let g:doom_disabled_plugins = []
let g:doom_disabled_plugins = ['lazygit', 'minimap', 'restclient']
" Disabled plugins modules
" @default = ['git', 'lsp', 'web']
@ -98,8 +103,16 @@ let g:doom_disabled_modules = ['git', 'lsp', 'web']
" Install custom plugins
" @default = []
" example:
" let g:doom_custom_plugins = ['andweeb/presence.nvim']
" examples:
" plugins without options:
" let g:doom_custom_plugins = ['andweeb/presence.nvim']
" plugins with options:
" let g:doom_custom_plugins = [
" \ {
" \ 'repo': 'andweeb/presence.nvim',
" \ 'enabled': 1,
" \ }
" \ ]
let g:doom_custom_plugins = []
" Set the parsers for TreeSitter
@ -108,6 +121,25 @@ let g:doom_custom_plugins = []
" let g:doom_ts_parsers = ['python', 'javascript']
let g:doom_ts_parsers = []
" Set the Terminal direction
" Available directions:
" - vertical
" - horizontal
" - window
" - float
" @default = 'vertical'
let g:doom_terminal_direction = 'vertical'
" Set the Terminal width
" Applies only to float direction
" @default = 70
let g:doom_terminal_width = 70
" Set the Terminal height
" Applies to all directions except window
" @default = 20
let g:doom_terminal_height = 20
" Conceal level
" Set Neovim conceal level
" 0 : Disable indentline and show all
@ -115,7 +147,6 @@ let g:doom_ts_parsers = []
" 2 : Concealed text is completely hidden unless it has a custom replacement
" character defined
" 3 : Concealed text is completely hidden
" @default = 0
let g:doom_conceallevel = 0
" Logging level

11
init.lua

@ -0,0 +1,11 @@
---[[---------------------------------------]]---
-- init.lua - Init file of Doom Nvim --
-- Author: NTBBloodbath --
-- License: MIT --
---[[---------------------------------------]]---
-- Utility functions
require('doom.utils')
-- Main configurations
require('doom.config.main')
require('doom.config.ui')

7
init.vim

@ -1,7 +0,0 @@
"================================================
" init.lua - Init file of Doom Nvim
" Author: NTBBloodbath
" License: MIT
"================================================
execute 'source' fnamemodify(expand('<sfile>'), ':h').'/config/main.vim'

2
install.sh

@ -32,7 +32,7 @@ BYellow='\033[1;33m' # Yellow
# }}}
# Doom Nvim version
DoomNvimVersion='1.2.1'
DoomNvimVersion='2.0.0'
# System OS
System="$(uname -s)"

102
lua/configs/lsp.lua

@ -1,102 +0,0 @@
-- taken from https://github.com/neovim/nvim-lspconfig#keybindings-and-completion
-- changed servers and ctermbg=237
-- added buf_set_keymap('n', 'ga', '<Cmd>lua vim.lsp.buf.code_action()<CR>', opts)
local nvim_lsp = require('lspconfig')
-- Snippets support
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
-- Signature help
require('lsp_signature').on_attach()
-- Vscode-like pictograms on completion
require('lspkind').init({
with_text = true,
symbol_map = {
Text = '',
Method = 'ƒ',
Function = '',
Constructor = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = ''
},
})
local on_attach = function(client, bufnr)
function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
opts = { noremap=true, silent=true }
buf_set_keymap('n', 'ga', '<Cmd>lua vim.lsp.buf.code_action()<CR>', opts)
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
buf_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
buf_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
buf_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
-- Set some keybinds conditional on server capabilities
if client.resolved_capabilities.document_formatting then
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
elseif client.resolved_capabilities.document_range_formatting then
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.range_formatting()<CR>", opts)
end
-- Set autocommands conditional on server_capabilities
if client.resolved_capabilities.document_highlight then
vim.api.nvim_exec([[
hi LspReferenceRead ctermbg=237 guibg=LightYellow
hi LspReferenceText ctermbg=237 guibg=LightYellow
hi LspReferenceWrite ctermbg=237 guibg=LightYellow
augroup lsp_document_highlight
autocmd! * <buffer>
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
]], false)
end
end
--[[-----------------]]--
-- LSP Setup --
--]]-----------------[[--
-- https://github.com/kabouzeid/nvim-lspinstall#advanced-configuration-recommended
local function setup_servers()
-- Provide the missing :LspInstall
require('lspinstall').setup()
local servers = require('lspinstall').installed_servers()
for _, server in pairs(servers) do
nvim_lsp[server].setup{}
end
end
setup_servers()
-- Automatically reload after `:LspInstall <server>` so we don't have to restart neovim
require('lspinstall').post_install_hook = function ()
setup_servers() -- reload installed servers
vim.cmd("bufdo e") -- this triggers the FileType autocmd that starts the server
end

6
lua/configs/nvim-colorizer.lua

@ -1,6 +0,0 @@
-- https://github.com/norcalli/nvim-colorizer.lua#customization
require('colorizer').setup {
'*'; -- Highlight all files, but customize some others.
css = { rgb_fn = true; }; -- Enable parsing rgb(...) functions in css.
html = { names = false; } -- Disable parsing "names" like Blue or Gray
}

29
lua/configs/nvim-compe.lua

@ -1,29 +0,0 @@
--- nvim-compe configuration
-- https://github.com/hrsh7th/nvim-compe#lua-config
require('compe').setup {
enabled = true;
autocomplete = true;
debug = false;
min_length = 2;
preselect = 'enable';
throttle_time = 80;
source_timeout = 200;
incomplete_delay = 400;
max_abbr_width = 100;
max_kind_width = 100;
max_menu_width = 100;
documentation = true;
source = {
path = true;
buffer = true;
calc = true;
vsnip = true;
nvim_lsp = true;
nvim_lua = true;
spell = true;
tags = true;
snippets_nvim = true;
treesitter = true;
};
}

38
lua/configs/nvim-gitsigns.lua

@ -1,38 +0,0 @@
require('gitsigns').setup {
signs = {
add = {hl = 'GitSignsAdd' , text = '', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
change = {hl = 'GitSignsChange', text = '', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
topdelete = {hl = 'GitSignsDelete', text = '', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
},
numhl = false,
linehl = false,
keymaps = {
-- Default keymap options
noremap = true,
buffer = true,
['n ]c'] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns\".next_hunk()<CR>'"},
['n [c'] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns\".prev_hunk()<CR>'"},
['n <leader>gS'] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
['n <leader>gu'] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
['n <leader>gr'] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
['n <leader>gR'] = '<cmd>lua require"gitsigns".reset_buffer()<CR>',
['n <leader>gh'] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
['n <leader>gb'] = '<cmd>lua require"gitsigns".blame_line()<CR>',
-- Text objects
['o ih'] = ':<C-U>lua require"gitsigns".select_hunk()<CR>',
['x ih'] = ':<C-U>lua require"gitsigns".select_hunk()<CR>'
},
watch_index = {
interval = 1000
},
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
use_decoration_api = true,
use_internal_diff = true, -- If luajit is present
}

50
lua/configs/nvim-telescope.lua

@ -1,50 +0,0 @@
-- https://github.com/nvim-telescope/telescope.nvim#telescope-defaults
-- Required to close with ESC in insert mode
local actions = require('telescope.actions')
local telescope = require('telescope')
telescope.setup{
defaults = {
mappings = {
i = {
['<esc>'] = actions.close
}
},
vimgrep_arguments = {
'rg',
'--pretty',
'--with-filename',
'--column',
'--smart-case'
},
prompt_position = "bottom",
prompt_prefix = ">",
initial_mode = "insert",
selection_strategy = "reset",
sorting_strategy = "descending",
layout_strategy = "horizontal",
layout_defaults = {
-- TODO add builtin options.
},
file_sorter = require'telescope.sorters'.get_fuzzy_file,
file_ignore_patterns = {},
generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
shorten_path = true,
winblend = 0,
width = 0.75,
preview_cutoff = 80,
results_height = 1,
results_width = 0.8,
border = {},
borderchars = { '', '', '', '', '', '', '', ''},
color_devicons = true,
use_less = true,
set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil,
file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
-- Developer configurations: Not meant for general override
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker
}
}

9
lua/configs/nvim-toggleterm.lua

@ -1,9 +0,0 @@
require('toggleterm').setup{
size = 10,
open_mapping = [[<c-t>]],
shade_filetypes = {},
shade_terminals = true,
start_in_insert = true,
persist_size = true,
direction = 'horizontal',
}

203
lua/configs/statusline.lua

@ -1,203 +0,0 @@
-- Extracted from https://github.com/glepnir/galaxyline.nvim/blob/main/example/eviline.lua
-- Credits goes to its author (glepnir) :)
local gl = require('galaxyline')
local colors = require('galaxyline.theme').default
local condition = require('galaxyline.condition')
local gls = gl.section
gl.short_line_list = {'NvimTree','vista','dbui','packer'}
gls.left[1] = {
RainbowRed = {
provider = function() return '' end,
highlight = {colors.blue,colors.bg}
},
}
gls.left[2] = {
ViMode = {
provider = function()
-- auto change color according the vim mode
local mode_color = {
n = colors.red, i = colors.green, v = colors.blue,
[''] = colors.blue, V = colors.blue,
c = colors.magenta, no = colors.red, s = colors.orange,
S = colors.orange, [''] = colors.orange,
ic = colors.yellow, R = colors.violet, Rv = colors.violet,
cv = colors.red, ce = colors.red, r = colors.cyan,
rm = colors.cyan, ['r?'] = colors.cyan,
['!'] = colors.red, t = colors.red
}
vim.api.nvim_command('hi GalaxyViMode guifg='..mode_color[vim.fn.mode()])
return ''
end,
highlight = {colors.red,colors.bg,'bold'},
},
}
gls.left[3] = {
FileSize = {
provider = 'FileSize',
condition = condition.buffer_not_empty,
highlight = {colors.fg,colors.bg}
}
}
gls.left[4] ={
FileIcon = {
provider = 'FileIcon',
condition = condition.buffer_not_empty,
highlight = {require('galaxyline.provider_fileinfo').get_file_icon_color,colors.bg},
},
}
gls.left[5] = {
FileName = {
provider = 'FileName',
condition = condition.buffer_not_empty,
highlight = {colors.magenta,colors.bg,'bold'}
}
}
gls.left[6] = {
LineInfo = {
provider = 'LineColumn',
separator = ' ',
separator_highlight = {'NONE',colors.bg},
highlight = {colors.fg,colors.bg},
},
}
gls.left[7] = {
PerCent = {
provider = 'LinePercent',
separator = ' ',
separator_highlight = {'NONE',colors.bg},
highlight = {colors.fg,colors.bg,'bold'},
}
}
gls.left[8] = {
DiagnosticError = {
provider = 'DiagnosticError',
icon = '',
highlight = {colors.red,colors.bg}
}
}
gls.left[9] = {
DiagnosticWarn = {
provider = 'DiagnosticWarn',
icon = '',
highlight = {colors.yellow,colors.bg},
}
}
gls.left[10] = {
DiagnosticHint = {
provider = 'DiagnosticHint',
icon = '',
highlight = {colors.cyan,colors.bg},
}
}
gls.left[11] = {
DiagnosticInfo = {
provider = 'DiagnosticInfo',
icon = '',
highlight = {colors.blue,colors.bg},
}
}
gls.mid[1] = {
ShowLspClient = {
provider = 'GetLspClient',
condition = function ()
local tbl = {['dashboard'] = true,['']=true}
if tbl[vim.bo.filetype] then
return false
end
return true
end,
icon = ' LSP: ',
highlight = {colors.cyan,colors.bg,'bold'}
}
}
gls.right[1] = {
FileEncode = {
provider = 'FileEncode',
condition = condition.hide_in_width,
separator = ' ',
separator_highlight = {'NONE',colors.bg},
highlight = {colors.green,colors.bg,'bold'}
}
}
gls.right[2] = {
FileFormat = {
provider = 'FileFormat',
condition = condition.hide_in_width,
separator = ' ',
separator_highlight = {'NONE',colors.bg},
highlight = {colors.green,colors.bg,'bold'}
}
}
gls.right[3] = {
GitIcon = {
provider = function() return '' end,
condition = condition.check_git_workspace,
separator = ' ',
separator_highlight = {'NONE',colors.bg},
highlight = {colors.violet,colors.bg,'bold'},
}
}
gls.right[4] = {
GitBranch = {
provider = 'GitBranch',
condition = condition.check_git_workspace,
highlight = {colors.violet,colors.bg,'bold'},
}
}
gls.right[5] = {
DiffAdd = {
provider = 'DiffAdd',
condition = condition.hide_in_width,
icon = '',
highlight = {colors.green,colors.bg},
}
}
gls.right[6] = {
DiffModified = {
provider = 'DiffModified',
condition = condition.hide_in_width,
icon = '',
highlight = {colors.orange,colors.bg},
}
}
gls.right[7] = {
DiffRemove = {
provider = 'DiffRemove',
condition = condition.hide_in_width,
icon = '',
highlight = {colors.red,colors.bg},
}
}
gls.right[8] = {
RainbowBlue = {
provider = function() return '' end,
highlight = {colors.blue,colors.bg}
},
}
gls.short_line_left[1] = {
BufferType = {
provider = 'FileTypeName',
separator = ' ',
separator_highlight = {'NONE',colors.bg},
highlight = {colors.blue,colors.bg,'bold'}
}
}
gls.short_line_left[2] = {
SFileName = {
provider = 'SFileName',
condition = condition.buffer_not_empty,
highlight = {colors.fg,colors.bg,'bold'}
}
}
gls.short_line_right[1] = {
BufferIcon = {
provider= 'BufferIcon',
highlight = {colors.fg,colors.bg}
}
}

48
lua/doom/config/load_plugins.lua

@ -0,0 +1,48 @@
-- /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
if fn['doom#functions#checkplugin']('pears.nvim') == 1 then
require('plugins.configs.nvim-pears')
end
if fn['doom#functions#checkplugin']('nvim-lspconfig') == 1 then
require('plugins.configs.lsp')
end
if fn['doom#functions#checkplugin']('nvim-colorizer.lua') == 1 then
require('plugins.configs.nvim-colorizer')
end
if fn['doom#functions#checkplugin']('nvim-compe') == 1 then
require('plugins.configs.nvim-compe')
end
if fn['doom#functions#checkplugin']('focus.nvim') == 1 then
require('plugins.configs.nvim-focus')
end
if fn['doom#functions#checkplugin']('telescope.nvim') == 1 then
require('plugins.configs.nvim-telescope')
end
if fn['doom#functions#checkplugin']('nvim-toggleterm.lua') == 1 then
require('plugins.configs.nvim-toggleterm')
end
if fn['doom#functions#checkplugin']('nvim-tree.lua') == 1 then
require('plugins.configs.nvim-tree')
end
if fn['doom#functions#checkplugin']('galaxyline.nvim') == 1 then
require('plugins.configs.statusline')
end
if fn['doom#functions#checkplugin']('nvim-treesitter') == 1 then
require('plugins.configs.tree-sitter')
end
if fn['doom#functions#checkplugin']('gitsigns.nvim') == 1 then
require('plugins.configs.nvim-gitsigns')
end
if fn['doom#functions#checkplugin']('which-key.nvim') == 1 then
require('plugins.configs.which-key')
end
if fn['doom#functions#checkplugin']('symbols-outline.nvim') == 1 then
require('plugins.configs.symbols')
end
if fn['doom#functions#checkplugin']('auto-session') == 1 then
require('plugins.configs.auto-session')
end
if fn['doom#functions#checkplugin']('format.nvim') == 1 then
require('plugins.configs.nvim-format')
end

29
lua/doom/config/main.lua

@ -0,0 +1,29 @@
---[[---------------------------------------]]---
-- main.vim - Core of Doom Nvim --
-- Author: NTBBloodbath --
-- License: MIT --
---[[---------------------------------------]]---
-- If packer.nvim is not installed then install it
local packer_install_path = fn.stdpath('data')
.. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(packer_install_path)) > 0 then
execute(
'silent !git clone https://github.com/wbthomason/packer.nvim '
.. packer_install_path
)
execute('packadd packer.nvim')
end
-- Set some configs on load
if fn.has('vim_starting') == 1 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
fn['doom#begin']()
require('plugins')
require('doom.config.load_plugins')
fn['doom#end']()

32
lua/doom/config/ui.lua

@ -0,0 +1,32 @@
---[[---------------------------------------]]---
-- ui.lua - Doom Nvim UI settings --
-- Author: NTBBloodbath --
-- License: MIT --
---[[---------------------------------------]]---
-- If no colorscheme was established then fallback to defauls
if not is_empty(g.doom_colorscheme) then
try({
function()
execute('set background=' .. g.doom_colorscheme_bg)
execute('colorscheme ' .. g.doom_colorscheme)
end,
catch({
function(_)
fn['doom#logging#message']('!', 'Colorscheme not found', 1)
execute('colorscheme ' .. g.doom_colorscheme)
end,
}),
})
else
fn['doom#logging#message']('!', 'Forced default Doom colorscheme', 1)
execute('colorscheme doom-one')
end
-- If guicolors are enabled
if g.doom_enable_guicolors == 1 then
if fn.exists('+termguicolors') then
opt('o', 'termguicolors', true)
elseif fn.exists('+guicolors') then
opt('o', 'guicolors', true)
end
end

111
lua/doom/health.lua

@ -1,75 +1,70 @@
---[[----------]]---
-- Wrappers --
---]]----------[[---
local fn = vim.fn
-- Health status
local health_start = fn['health#report_start']
local health_ok = fn['health#report_ok']
local health_ok = fn['health#report_ok']
local health_error = fn['health#report_error']
local health_warn = fn['health#report_warn']
local health_warn = fn['health#report_warn']
local M = {}
-- Installation health
local function install_health()
health_start('Installation')
health_start('Installation')
---[[-----------------------]]---
-- REQUIRED DEPENDENCIES --
---]]-----------------------[[---
-- Check Git
if fn.executable('git') == 0 then
health_error('`git` executable not found.', {
'Install it with your package manager.',
'Check that your `$PATH` is set correctly.'
})
else
health_ok('`git` executable found.')
end
---[[-----------------------]]---
-- REQUIRED DEPENDENCIES --
---]]-----------------------[[---
-- Check Git
if fn.executable('git') == 0 then
health_error('`git` executable not found.', {
'Install it with your package manager.',
'Check that your `$PATH` is set correctly.',
})
else
health_ok('`git` executable found.')
end
---[[-----------------------]]---
-- OPTIONAL DEPENDENCIES --
---]]-----------------------[[---
-- Ripgrep and fd
if 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.'
})
else
health_ok('`rg` executable found.')
end
if 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.'
})
else
health_ok('`fd` executable found.')
end
---[[-----------------------]]---
-- OPTIONAL DEPENDENCIES --
---]]-----------------------[[---
-- Ripgrep and fd
if 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.',
})
else
health_ok('`rg` executable found.')
end
if 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.',
})
else
health_ok('`fd` executable found.')
end
-- Check NodeJS and NPM
if 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
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'
})
else
health_ok('`npm` executable found.')
end
-- Check NodeJS and NPM
if 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
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',
})
else
health_ok('`npm` executable found.')
end
end
function M.checkhealth()
-- Installation checks
install_health()
-- Installation checks
install_health()
end
return M

311
lua/doom/keybindings.lua

@ -0,0 +1,311 @@
local wk = require('which-key')
-- Define leader key to space
-- and call leader mapper
map('n', '<Space>', '<Nop>')
api.nvim_set_var('mapleader', ' ')
-------------------------------------------------
---[[-------------------------------]]---
-- Custom Key Mappings --
-- --
-- <leader>b = Buffer Menu --
-- <leader>f = File Menu --
-- <leader>g = Git Menu --
-- <leader>p = Plugin Menu --
-- <leader>r = Runner Menu --
-- <leader>s = Session Menu --
-- <leader>t = Toggle Menu --
-- <leader>w = Window Menu --
-- --
-- TAB = Cycle buffers --
-- ESC = Search highlight off --
-- F2 = Toggle Tagbar --
-- F3 = Toggle Tree Explorer --
-- F4 = Toggle Terminal --
-- F5 = Toggle Minimap --
-- F6 = Toggle Zen Mode --
-- F7 = Run restclient --
---]]-------------------------------[[---
-------------------------------------------------
-- Additional options for mappings
local opts = { silent = true }
---[[-----------------]]---
-- LSP Keybindings --
---]]-----------------[[---
-- If the LSP group is not disabled or the nvim-compe plugin is not disabled
-- then set its mappings.
if
not has_value(g.doom_disabled_modules, 'lsp')
and (not has_value(g.doom_disabled_plugins, 'compe'))
then
-- https://github.com/hrsh7th/nvim-compe#mappings
map('i', '<expr> <C-Space>', fn['compe#complete'](), opts)
map('i', '<expr> <CR>', fn['compe#confirm']('<CR>'), opts)
map('i', '<expr> <C-e>', fn['compe#close']('<C-e>'), opts)
map(
'i',
'<expr> <C-f>',
fn['compe#scroll']({ delta = '+4' }),
opts
)
map(
'i',
'<expr> <C-d>',
fn['compe#scroll']({ delta = '-4' }),
opts
)
end
-- TAB to cycle buffers too, why not?
map('n', '<Tab>', ':bnext<CR>', opts)
map('n', '<S-Tab>', ':bprevious<CR>', opts)
-- ESC to turn off search highlighting
map('n', '<esc>', ':noh<CR>', opts)
--- F<n> keybindings
if not has_value(g.doom_disabled_plugins, 'tagbar') then
map('n', '<F2>', ':SymbolsOutline<CR>')
end
if not has_value(g.doom_disabled_plugins, 'tree') then
map('n', '<F3>', ':NvimTreeToggle<CR>')
end
if not has_value(g.doom_disabled_plugins, 'terminal') then
map('n', '<F4>', ':ToggleTerm<CR>')
end
if not has_value(g.doom_disabled_plugins, 'minimap') then
map('n', '<F5>', ':MinimapToggle<CR>')
end
if not has_value(g.doom_disabled_plugins, 'zen') then
map('n', '<F6>', ':TZAtaraxis<CR>')
end
if
not has_value(g.doom_disabled_modules, 'web')
and (not has_value(g.doom_disabled_plugins, 'restclient'))
then
map('n', '<F7>', ':DotHttp<CR>')
end
---[[-----------------]]---
-- Disable keys --
---]]-----------------[[---
-- Disable accidentally pressing ctrl-z and suspending
map('n', '<c-z>', '<Nop>')
-- Disable ex mode
map('n', 'Q', '<Nop>')
-- Disable recording
map('n', 'q', '<Nop>')
-- Fast exit from Doom Nvim and write messages to logs
map('n', 'ZZ', ':call doom#functions#quit_doom(1,1)<CR>')
---[[-----------------]]---
-- Leader keys --
---]]-----------------[[---
-- Buffers
wk.register({
['<leader>'] = {
b = {
name = '+buffer',
['1'] = { ':BufferGoto 1<CR>', 'Buffer 1' },
['2'] = { ':BufferGoto 2<CR>', 'Buffer 2' },
['3'] = { ':BufferGoto 3<CR>', 'Buffer 3' },
['4'] = { ':BufferGoto 4<CR>', 'Buffer 4' },
['5'] = { ':BufferGoto 5<CR>', 'Buffer 5' },
['6'] = { ':BufferGoto 6<CR>', 'Buffer 6' },
['7'] = { ':BufferGoto 7<CR>', 'Buffer 7' },
['8'] = { ':BufferGoto 8<CR>', 'Buffer 8' },
['9'] = { ':BufferLast<CR>', 'Last buffer' },
c = { ':BufferClose<CR>', 'Close buffer' },
f = { ':FormatWrite<CR>', 'Format buffer' },
n = { ':BufferNext<CR>', 'Next buffer' },
P = { ':BufferPick<CR>', 'Pick buffer' },
p = { ':BufferPrevious<CR>', 'Previous buffer' },
},
},
})
-- Plugins
wk.register({
['<leader>'] = {
p = {
name = '+plugins',
c = { ':PackerClean<CR>', 'Clean disabled or unused plugins' },
i = { ':PackerInstall<CR>', 'Install missing plugins' },
p = {
':PackerProfile<CR>',
'Profile the time taken loading your plugins',
},
s = {
':PackerSync<CR>',
'Performs PackerClean and then PackerUpdate',
},
u = { ':PackerUpdate<CR>', 'Update your plugins' },
},
},
})
-- Order
wk.register({
['<leader>'] = {
o = {
name = '+order',
d = { ':BufferOrderByDirectory<CR>', 'Sort by directory' },
l = { ':BufferOrderByLanguage<CR>', 'Sort by language' },
n = { ':BufferMoveNext<CR>', 'Re-order buffer to next' },
p = { ':BufferMovePrevious<CR>', 'Re-order buffer to previous' },
},
},
})
-- File
wk.register({
['<leader>'] = {
f = {
name = '+file',
c = { ':e $MYVIMRC<CR>', 'Edit Neovim configuration' },
n = { ':new<CR>', 'Create a new unnamed buffer' },
f = { ':Telescope find_files<CR>', 'Find files' },
b = { ':Telescope marks<CR>', 'Bookmarks' },
W = { ':Telescope live_grep<CR>', 'Find word' },
t = { ':Telescope help_tags<CR>', 'Help tags' },
h = { ':Telescope oldfiles<CR>', 'Recently opened files' },
w = { ':SudaWrite<CR>', 'Write file with sudo permissions' },
r = { ':SudaRead<CR>', 'Re-open file with sudo permissions' },
},
},
})
-- Window
wk.register({
['<leader>'] = {
w = {
name = '+window',
C = { ':only<CR>', 'Close all other windows' },
c = { ':close<CR>', 'Close current window' },
h = { ':split<CR>', 'Split horizontally' },
v = { 'vsplit<CR>', 'Split vertically' },
},
},
})
-- Sessions
wk.register({
['<leader>'] = {
s = {
name = '+sessions',
s = { ':SaveSession<CR>', 'Save current session' },
r = { ':RestoreSession<CR>', 'Restore previously saved session' },
l = {
':Telescope session-lens search_session<CR>',
'Session switcher',
},
},
},
})
-- Doom Menu
wk.register({
['<leader>'] = {
d = {
name = '+doom',
c = {
':e ~/.config/doom-nvim/doomrc<CR>',
'Edit your Doom Nvim configuration',
},
d = { ':help doom_nvim<CR>', 'Open Doom Nvim documentation' },
u = { ':DoomUpdate<CR>', 'CHeck Doom Nvim udpates' },
r = {
':call doom#functions#createReport()<CR>',
'Create crash report',
},
},
},
})
-- Toggler
wk.register({
['<leader>'] = {
t = {
name = '+toggle',
s = { ':Dashboard<CR>', 'Open start screen' },
c = { ':DashboardChangeColorscheme<CR>', 'Change colorscheme' },
e = { ':NvimTreeToggle<CR>', 'Toggle Tree Explorer' },
m = { ':MinimapToggle<CR>', 'Toggle Minimap' },
S = { ':SymbolsOutline<CR>', 'Toggle Symbols view' },
t = { ':ToggleTerm<CR>', 'Toggle terminal' },
},
},
})
-- If web is enabled and restclient is enabled too
if
not has_value(g.doom_disabled_modules, 'web')
and (not has_value(g.doom_disabled_plugins, 'restclient'))
then
wk.register({
['<leader>'] = {
r = {
name = '+runner',
r = {
':DotHttp<CR>',
'Run restclient on the line that the cursor is currently on',
},
},
},
})
end
-- If LSP is enabled
if
not has_value(g.doom_disabled_modules, 'lsp')
and (not has_value(g.doom_disabled_plugins, 'compe'))
then
wk.register({
['<leader>'] = {
l = {
name = '+lsp',
d = {
'<cmd>lua vim.lsp.buf.type_definition()<CR>',
'Show type definition',
},
l = {
'<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>',
'Show line diagnostics',
},
L = {
'<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>',
'Diagnostics into location list',
},
},
},
})
end
-- If Git is enabled
if not has_value(g.doom_disabled_modules, 'git') then
wk.register({
['<leader>'] = {
g = {
name = '+git',
o = { ':LazyGit<CR>', 'Open LazyGit' },
P = { ':TermExec cmd="git pull"<CR>', 'Pull' },
p = { ':TermExec cmd="git push"<CR>', 'Push' },
S = { 'Stage hunk' },
s = { ':TermExec cmd="git status"<CR>', 'Status' },
u = { 'Undo stage hunk' },
R = { 'Reset buffer' },
r = { 'Reset hunk' },
h = { 'Preview hunk' },
b = { 'Blame line' },
},
},
})
end

97
lua/doom/utils/init.lua

@ -0,0 +1,97 @@
-------------------- HELPERS --------------------
api, cmd, fn = vim.api, vim.cmd, vim.fn
keymap, execute, g = api.nvim_set_keymap, api.nvim_command, vim.g
scopes = { o = vim.o, b = vim.bo, w = vim.wo }
--- Require packer so we can use `packer.use` function in `custom_plugins` function
local packer = require('packer')
-- Mappings wrapper, extracted from
-- https://github.com/ojroques/dotfiles/blob/master/nvim/init.lua#L8-L12
function map(mode, lhs, rhs, opts)
local options = { noremap = true }
if opts then
default_options = vim.tbl_extend('force', options, opts)
end
keymap(mode, lhs, rhs, options)
end
-- Options wrapper, extracted from
-- https://github.com/ojroques/dotfiles/blob/master/nvim/init.lua#L14-L17
function opt(scope, key, value)
scopes[scope][key] = value
if scope ~= 'o' then
scopes['o'][key] = value
end
end
-- Check if string is empty or if it's nil
function is_empty(str)
return str == '' or str == nil
end
-- Search if a table have the value we are looking for,
-- useful for plugins management
function has_value(tabl, val)
for _, value in ipairs(tabl) do
if value == val then
return true
end
end
return false
end
-- try/catch statements, see
-- https://gist.github.com/cwarden/1207556
function catch(err)
return err[1]
end
function try(block)
status, result = pcall(block[1])
if not status then
block[2](result)
end
return result
end
-- A better and less primitive implementation of custom plugins in Doom Nvim
function custom_plugins(plugins)
-- if a plugin have some configs like enabled or requires then we will
-- store them in that table
local plugin_with_configs = {}
if type(plugins) ~= 'string' then
for idx, val in pairs(plugins) do
-- Create the correct plugin structure to packer
-- use {
-- url,
-- enabled,
-- requires
-- }
if idx == 'repo' then
table.insert(plugin_with_configs, val)
end
if idx == 'enabled' then
if val == 1 then
plugin_with_configs['enabled'] = true
else
plugin_with_configs['enabled'] = false
end
end
if idx == 'requires' then
plugin_with_configs['requires'] = val
end
end
-- Send the configured plugin to packer
packer.use(plugin_with_configs)
else
-- Send the simple plugins, e.g. those who have not declared with configs
-- 'user/repo' ← simple plugin
-- { 'user/repo', opts } ← configured plugin
packer.use(plugins)
end
end

373
lua/plugins.lua

@ -1,373 +0,0 @@
-- Manage vim global variables
local g = vim.g
local nvim_set_var = vim.api.nvim_set_var
-- Useful function to see if the Vim variable have the value we are looking for
function has_value(tabl, val)
for _, value in ipairs(tabl) do
if value == val then
return true
end
end
return false
end
----- Plugins modules
-- Essentials, ! cannot be disabled (Plugin manager, vimpeccable and languages)
-- UI Related, / can be disabled (All look-and-feel plugins)
-- Fuzzy Search (fuzzy), + can be disabled (Fuzzy search & more)
-- Git Integration (git), + can be disabled (Some git plugins, including LazyGit)
-- Completion (lsp), + can be disabled (Built-in LSP configurations)
-- File-related (files), + can be disabled (EditorConfig, formatting, Tree-sitter, etc)
-- Web-related (web), + can be disabled (Colorizer, emmet, rest client)
--
-- Legend:
-- ! : The group and its plugins cannot be disabled
-- / : The group cannot be disabled but some of its plugins can be
-- + : The group and its plugins can be disabled
--
-- NOTES:
-- 1. You can disable an entire group or just some or their plugins based on
-- the legend, please refer to our documentation to learn how to do it.
-- 2. The UI dashboard depends on the Fuzzy Search group for
-- providing some features, but if you do not want to use them,
-- you can safely disable the Fuzzy Search group.
-- 3. We do not provide other LSP integration like coc.nvim,
-- please refer to our FAQ to see why.
--- Set disabled plugins modules and plugins
local disabled_plugins = {}
--- Disabled modules
local disabled_fuzzy = has_value(g.doom_disabled_modules, 'fuzzy')
local disabled_git = has_value(g.doom_disabled_modules, 'git')
local disabled_completion = has_value(g.doom_disabled_modules, 'lsp')
local disabled_files = has_value(g.doom_disabled_modules, 'files')
local disabled_web = has_value(g.doom_disabled_modules, 'web')
local packer = require('packer')
return packer.startup(function()
-----[[------------]]-----
--- Essentials ---
-----]]------------[[-----
-- Plugins manager
use 'wbthomason/packer.nvim'
-- Auxiliar functions for using Lua in Neovim
use 'svermeulen/vimpeccable'
-- Languages support
use 'sheerun/vim-polyglot'
-----[[------------]]-----
--- UI Related ---
-----]]------------[[-----
-- Fancy start screen
-- cannot be disabled
use {
'glepnir/dashboard-nvim',
disabled = false
}
-- Colorschemes
-- cannot be disabled at the moment
use {
'sainnhe/sonokai',
'sainnhe/edge',
'sainnhe/everforest',
'wadackel/vim-dogrun',
'joshdick/onedark.vim',
'ajmwagar/vim-deus'
}
-- File tree
local disabled_tree = has_value(g.doom_disabled_plugins, 'tree')
if disabled_tree then
table.insert(disabled_plugins, 'tree')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'kyazdani42/nvim-tree.lua',
requires = { 'kyazdani42/nvim-web-devicons' },
disabled = disabled_tree
}
-- Statusline
-- can be disabled to use your own statusline
local disabled_statusline = has_value(g.doom_disabled_plugins, 'statusline')
if disabled_statusline then
table.insert(disabled_plugins, 'statusline')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'glepnir/galaxyline.nvim',
disabled = disabled_statusline
}
-- Tabline
-- can be disabled to use your own tabline
local disabled_tabline = has_value(g.doom_disabled_plugins, 'tabline')
if disabled_tabline then
table.insert(disabled_plugins, 'tabline')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'romgrk/barbar.nvim',
disabled = disabled_tabline
}
-- Better splits
-- NOTE: we are using this specific branch because the main still does not have
-- the ignore filetypes feature, thanks to its owner per adding it <3
local disabled_focus = has_value(g.doom_disabled_plugins, 'focus')
if disabled_focus then
table.insert(disabled_plugins, 'focus')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'beauwilliams/focus.nvim',
branch = 'cust_filetypes',
disabled = disabled_focus
}
-- Better terminal
-- can be disabled to use your own terminal plugin
local disabled_terminal = has_value(g.doom_disabled_plugins, 'terminal')
if disabled_terminal then
table.insert(disabled_plugins, 'terminal')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'akinsho/nvim-toggleterm.lua',
disabled = disabled_terminal
}
-- Viewer & finder for LSP symbols and tags
local disabled_tagbar = has_value(g.doom_disabled_plugins, 'tagbar')
if disabled_tagbar then
table.insert(disabled_plugins, 'tagbar')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'liuchengxu/vista.vim',
disabled = disabled_tagbar
}
-- Minimap
-- Depends on wfxr/code-minimap to work!
local disabled_minimap = has_value(g.doom_disabled_plugins, 'minimap')
if disabled_minimap then
table.insert(disabled_plugins, 'minimap')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'wfxr/minimap.vim',
disabled = disabled_minimap
}
-- Keybindings menu like Emacs's guide-key
-- cannot be disabled
use {
'spinks/vim-leader-guide',
disabled = false
}
-- Distraction free environment
local disabled_goyo = has_value(g.doom_disabled_plugins, 'goyo')
if disabled_goyo then
table.insert(disabled_plugins, 'goyo')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'junegunn/goyo.vim',
disabled = disabled_goyo
}
-----[[--------------]]-----
--- Fuzzy Search ---
-----]]--------------[[-----
local disabled_telescope = has_value(g.doom_disabled_plugins, 'telescope')
if disabled_fuzzy and (not disabled_telescope) then
table.insert(disabled_plugins, 'telescope')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'nvim-telescope/telescope.nvim',
requires = {
{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}
},
disable = (disabled_fuzzy and true or disabled_telescope)
}
-----[[-------------]]-----
--- GIT RELATED ---
-----]]-------------[[-----
-- Git gutter better alternative, written in Lua
-- can be disabled to use your own git gutter plugin
local disabled_gitsigns = has_value(g.doom_disabled_plugins, 'gitsigns')
if disabled_git and (not disabled_gitsigns) then
table.insert(disabled_plugins, 'gitsigns')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'lewis6991/gitsigns.nvim',
disable = (disabled_git and true or disabled_gitsigns),
}
-- LazyGit integration
local disabled_lazygit = has_value(g.doom_disabled_plugins, 'lazygit')
if disabled_git and (not disabled_lazygit) then
table.insert(disabled_plugins, 'lazygit')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'kdheepak/lazygit.nvim',
requires = { 'nvim-lua/plenary.nvim' },
disable = (disabled_git and true or disabled_lazygit)
}
-----[[------------]]-----
--- Completion ---
-----]]------------[[-----
-- Built-in LSP Config
-- NOTE: It should not be disabled if you are going to use LSP!
local disabled_lspconfig = has_value(g.doom_disabled_plugins, 'lspconfig')
if disabled_lsp and (not disabled_lspconfig) then
table.insert(disabled_plugins, 'lspconfig')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'neovim/nvim-lspconfig',
disable = (disabled_completion and true or disabled_lspconfig)
}
-- Completion plugin
-- can be disabled to use your own completion plugin
local disabled_compe = has_value(g.doom_disabled_plugins, 'compe')
if disabled_lsp and (not disabled_compe) then
table.insert(disabled_plugins, 'compe')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'hrsh7th/nvim-compe',
requires = {
{'ray-x/lsp_signature.nvim'}, {'onsails/lspkind-nvim'},
{'norcalli/snippets.nvim'}
},
disable = (disabled_completion and true or disabled_compe)
}
-- provides the missing `:LspInstall` for `nvim-lspconfig`.
local disabled_lspinstall = has_value(g.doom_disabled_plugins, 'lspinstall')
if disabled_lsp and (not disabled_lspinstall) then
table.insert(disabled_plugins, 'lspinstall')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use 'kabouzeid/nvim-lspinstall'
-----[[--------------]]-----
--- File Related ---
-----]]--------------[[-----
-- Write / Read files without permissions (e.g. /etc files) without having
-- to use `sudo nvim /path/to/file`
local disabled_suda = has_value(g.doom_disabled_plugins, 'suda')
if disabled_files and (not disabled_suda) then
table.insert(disabled_plugins, 'suda')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'lambdalisue/suda.vim',
disable = (disabled_files and true or disabled_suda)
}
-- File formatting
-- can be disabled to use your own file formatter
local disabled_neoformat = has_value(g.doom_disabled_plugins, 'neoformat')
if disabled_files and (not disabled_neoformat) then
table.insert(disabled_plugins, 'neoformat')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'sbdchd/neoformat',
disable = (disabled_files and true or disabled_neoformat)
}
-- Autopairs
-- can be disabled to use your own autopairs
local disabled_autopairs = has_value(g.doom_disabled_plugins, 'autopairs')
if disabled_files and (not disabled_autopairs) then
table.insert(disabled_plugins, 'autopairs')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'windwp/nvim-autopairs',
disable = (disabled_files and true or disabled_autopairs)
}
-- Indent Lines
local disabled_indent_lines = has_value(g.doom_disabled_plugins, 'indentlines')
if disabled_files and (not disabled_indent_lines) then
table.insert(disabled_plugins, 'indentlines')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'Yggdroot/indentLine',
disable = (disabled_files and true or disabled_indent_lines)
}
-- EditorConfig support
local disabled_editorconfig = has_value(g.doom_disabled_plugins, 'editorconfig')
if disabled_files and (not disabled_editorconfig) then
table.insert(disabled_plugins, 'editorconfig')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'editorconfig/editorconfig-vim',
disable = (disabled_files and true or disabled_editorconfig)
}
-- Tree-Sitter
local disabled_treesitter = has_value(g.doom_disabled_plugins, 'treesitter')
if disabled_files and (not disabled_treesitter) then
table.insert(disabled_plugins, 'treesitter')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate',
disable = (disabled_files and true or disabled_treesitter)
}
-- Comments
-- can be disabled to use your own comments plugin
local disabled_kommentary = has_value(g.doom_disabled_plugins, 'kommentary')
if disabled_files and (not disabled_kommentary) then
table.insert(disabled_plugins, 'kommentary')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'b3nj5m1n/kommentary',
disable = (disabled_files and true or disabled_kommentary)
}
-----[[-------------]]-----
--- Web Related ---
-----]]-------------[[-----
-- Fastest colorizer without external dependencies!
local disabled_colorizer = has_value(g.doom_disabled_plugins, 'colorizer')
if disabled_web and (not disabled_colorizer) then
table.insert(disabled_plugins, 'colorizer')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'norcalli/nvim-colorizer.lua',
disable = (disabled_web and true or disabled_colorizer)
}
-- HTTP Client support
-- Depends on bayne/dot-http to work!
local disabled_restclient = has_value(g.doom_disabled_plugins, 'restclient')
if disabled_web and (not disabled_restclient) then
table.insert(disabled_plugins, 'restclient')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'bayne/vim-dot-http',
disable = (disabled_web and true or disabled_restclient)
}
-- Emmet plugin
local disabled_emmet = has_value(g.doom_disabled_plugins, 'emmet')
if disabled_web and (not disabled_emmet) then
table.insert(disabled_plugins, 'emmet')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'mattn/emmet-vim',
disable = (disabled_web and true or disabled_emmet)
}
-----[[----------------]]-----
--- Custom Plugins ---
-----]]----------------[[-----
-- If there are custom plugins
for _, plugin in ipairs(g.doom_custom_plugins) do
packer.use(plugin)
end
end)

10
lua/plugins/configs/auto-session.lua

@ -0,0 +1,10 @@
require('auto-session').setup({
-- Sets the log level of the plugin (debug, info, error)
logLevel = 'info',
-- Root dir where sessions will be stored (/home/user/.config/nvim/sessions/)
auto_session_root_dir = fn.stdpath('data') .. '/sessions/',
-- Enables/disables auto save/restore
auto_session_enabled = g.doom_autosave_sessions,
-- Enable keeping track and loading of the last session
auto_session_enable_last_session = g.doom_autoload_last_session,
})

0
lua/configs/autopairs.lua → lua/plugins/configs/autopairs.lua

180
lua/plugins/configs/lsp.lua

@ -0,0 +1,180 @@
-- taken from https://github.com/neovim/nvim-lspconfig#keybindings-and-completion
local nvim_lsp = require('lspconfig')
-- Snippets support
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
-- Signature help
require('lsp_signature').on_attach()
-- Vscode-like pictograms on completion
require('lspkind').init({
with_text = true,
symbol_map = {
Text = '',
Method = 'ƒ',
Function = '',
Constructor = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = '',
},
})
local on_attach = function(client, bufnr)
local function buf_set_option(...)
api.nvim_buf_set_option(bufnr, ...)
end
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
local opts = { silent = true }
map(
'n',
'ga',
'<Cmd>lua vim.lsp.buf.code_action()<CR>',
opts
)
map(
'n',
'gD',
'<Cmd>lua vim.lsp.buf.declaration()<CR>',
opts
)
map('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
map('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
map(
'n',
'gi',
'<cmd>lua vim.lsp.buf.implementation()<CR>',
opts
)
map(
'n',
'<C-k>',
'<cmd>lua vim.lsp.buf.signature_help()<CR>',
opts
)
map(
'n',
'<space>wa',
'<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>',
opts
)
map(
'n',
'<space>wr',
'<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>',
opts
)
map(
'n',
'<space>wl',
'<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>',
opts
)
map(
'n',
'<space>D',
'<cmd>lua vim.lsp.buf.type_definition()<CR>',
opts
)
map(
'n',
'<space>rn',
'<cmd>lua vim.lsp.buf.rename()<CR>',
opts
)
map('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
map(
'n',
'<space>e',
'<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>',
opts
)
map(
'n',
'[d',
'<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>',
opts
)
map(
'n',
']d',
'<cmd>lua vim.lsp.diagnostic.goto_next()<CR>',
opts
)
map(
'n',
'<space>q',
'<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>',
opts
)
-- Set some keybinds conditional on server capabilities
if client.resolved_capabilities.document_formatting then
map(
'n',
'<space>f',
'<cmd>lua vim.lsp.buf.formatting()<CR>',
opts
)
elseif client.resolved_capabilities.document_range_formatting then
map(
'n',
'<space>f',
'<cmd>lua vim.lsp.buf.range_formatting()<CR>',
opts
)
end
-- Set autocommands conditional on server_capabilities
if client.resolved_capabilities.document_highlight then
api.nvim_exec(
[[
hi LspReferenceRead ctermbg=237 guibg=LightYellow
hi LspReferenceText ctermbg=237 guibg=LightYellow
hi LspReferenceWrite ctermbg=237 guibg=LightYellow
augroup lsp_document_highlight
autocmd! * <buffer>
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
]],
false
)
end
end
--[[-----------------]]
--
-- LSP Setup --
-- ]]-----------------[[--
-- https://github.com/kabouzeid/nvim-lspinstall#advanced-configuration-recommended
local function setup_servers()
-- Provide the missing :LspInstall
require('lspinstall').setup()
local servers = require('lspinstall').installed_servers()
for _, server in pairs(servers) do
nvim_lsp[server].setup({})
end
end
setup_servers()
-- Automatically reload after `:LspInstall <server>` so we don't have to restart neovim
require('lspinstall').post_install_hook = function()
setup_servers() -- reload installed servers
cmd('bufdo e') -- this triggers the FileType autocmd that starts the server
end

6
lua/plugins/configs/nvim-colorizer.lua

@ -0,0 +1,6 @@
-- https://github.com/norcalli/nvim-colorizer.lua#customization
require('colorizer').setup({
'*', -- Highlight all files, but customize some others.
css = { rgb_fn = true }, -- Enable parsing rgb(...) functions in css.
html = { names = false }, -- Disable parsing "names" like Blue or Gray
})

29
lua/plugins/configs/nvim-compe.lua

@ -0,0 +1,29 @@
--- nvim-compe configuration
-- https://github.com/hrsh7th/nvim-compe#lua-config
require('compe').setup({
enabled = true,
autocomplete = true,
debug = false,
min_length = 2,
preselect = 'enable',
throttle_time = 80,
source_timeout = 200,
incomplete_delay = 400,
max_abbr_width = 100,
max_kind_width = 100,
max_menu_width = 100,
documentation = true,
source = {
path = true,
buffer = true,
calc = true,
vsnip = true,
nvim_lsp = true,
nvim_lua = true,
spell = true,
tags = true,
snippets_nvim = true,
treesitter = true,
},
})

2
lua/configs/nvim-focus.lua → lua/plugins/configs/nvim-focus.lua

@ -6,4 +6,4 @@ focus.enable = true
focus.width = 60
focus.height = 20
-- Set which filetypes focus will not resize
focus.excluded_filetypes = {'NvimTree', 'Vista', 'Minimap', 'terminal'}
focus.excluded_filetypes = { 'NvimTree', 'Vista', 'Minimap', 'terminal' }

115
lua/plugins/configs/nvim-format.lua

@ -0,0 +1,115 @@
require('format').setup({
['*'] = {
-- remove trailing whitespaces
{
cmd = {
"sed -i 's/[ \t]*$//'",
},
},
},
vim = {
{
cmd = {
function(file)
return string.format(
'stylua --config-path ~/.config/stylua/stylua.toml %s',
file
)
end,
},
start_pattern = '^lua << EOF$',
end_pattern = '^EOF$',
},
},
vimwiki = {
{
cmd = { 'prettier -w --parser babel' },
start_pattern = '^{{{javascript$',
end_pattern = '^}}}$',
},
},
lua = {
{
cmd = {
function(file)
return string.format(
'stylua --config-path ~/.config/stylua/stylua.toml %s',
file
)
end,
},
},
},
python = {
{
cmd = {
'yapf -i',
},
},
},
go = {
{
cmd = {
'gofmt -w',
'goimports -w',
},
tempfile_postfix = '.tmp',
},
},
javascript = {
{
cmd = {
'prettier -w',
'./node_modules/.bin/eslint --fix',
},
},
},
typescript = {
{
cmd = { 'prettier -w --parser typescript' },
},
},
html = {
{
cmd = { 'prettier -w --parser html' },
},
},
markdown = {
{
cmd = { 'prettier -w --parser markdown' },
},
{
cmd = {
'yapf -i',
},
start_pattern = '^```python$',
end_pattern = '^```$',
target = 'current',
},
},
css = {
{
cmd = { 'prettier -w --parser css' },
},
},
scss = {
{
cmd = { 'prettier -w --parser scss' },
},
},
json = {
{
cmd = { 'prettier -w --parser json' },
},
},
toml = {
{
cmd = { 'prettier -w --parser toml' },
},
},
yaml = {
{
cmd = { 'prettier -w --parser yaml' },
},
},
})

67
lua/plugins/configs/nvim-gitsigns.lua

@ -0,0 +1,67 @@
require('gitsigns').setup({
signs = {
add = {
hl = 'GitSignsAdd',
text = '',
numhl = 'GitSignsAddNr',
linehl = 'GitSignsAddLn',
},
change = {
hl = 'GitSignsChange',
text = '',
numhl = 'GitSignsChangeNr',
linehl = 'GitSignsChangeLn',
},
delete = {
hl = 'GitSignsDelete',
text = '_',
numhl = 'GitSignsDeleteNr',
linehl = 'GitSignsDeleteLn',
},
topdelete = {
hl = 'GitSignsDelete',
text = '',
numhl = 'GitSignsDeleteNr',
linehl = 'GitSignsDeleteLn',
},
changedelete = {
hl = 'GitSignsChange',
text = '~',
numhl = 'GitSignsChangeNr',
linehl = 'GitSignsChangeLn',
},
},
numhl = false,
linehl = false,
keymaps = {
-- Default keymap options
noremap = true,
buffer = true,
['n ]c'] = {
expr = true,
"&diff ? ']c' : '<cmd>lua require\"gitsigns\".next_hunk()<CR>'",
},
['n [c'] = {
expr = true,
"&diff ? '[c' : '<cmd>lua require\"gitsigns\".prev_hunk()<CR>'",
},
['n <leader>gS'] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
['n <leader>gu'] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
['n <leader>gr'] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
['n <leader>gR'] = '<cmd>lua require"gitsigns".reset_buffer()<CR>',
['n <leader>gh'] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
['n <leader>gb'] = '<cmd>lua require"gitsigns".blame_line()<CR>',
-- Text objects
['o ih'] = ':<C-U>lua require"gitsigns".select_hunk()<CR>',
['x ih'] = ':<C-U>lua require"gitsigns".select_hunk()<CR>',
},
watch_index = { interval = 1000 },
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
use_decoration_api = true,
use_internal_diff = true, -- If luajit is present
})

34
lua/plugins/configs/nvim-pears.lua

@ -0,0 +1,34 @@
local R = require('pears.rule')
require('pears').setup(function(conf)
conf.pair('(', ')')
conf.pair('{', '}')
conf.pair('[', ']')
conf.pair("'", {
close = "'",
should_expand = R.all_of(
-- Don't expand a quote if it comes after an alpha character
R.not_(R.start_of_context('[a-zA-Z]')),
-- Only expand when in a treesitter "string" node
R.child_of_node('string')
),
})
conf.pair('"', {
close = '"',
should_expand = R.all_of(
-- Don't expand a quote if it comes after an alpha character
R.not_(R.start_of_context('[a-zA-Z]')),
-- Only expand when in a treesitter "string" node
R.child_of_node('string')
),
})
conf.preset('tag_matching')
-- Completion integration with nvim-compe
conf.on_enter(function(pears_handle)
if fn.pumvisible() == 1 and fn.complete_info().selected ~= -1 then
return fn['compe#confirm']('<CR>')
else
pears_handle()
end
end)
end)

46
lua/plugins/configs/nvim-telescope.lua

@ -0,0 +1,46 @@
-- https://github.com/nvim-telescope/telescope.nvim#telescope-defaults
-- Required to close with ESC in insert mode
local actions = require('telescope.actions')
local telescope = require('telescope')
telescope.setup({
defaults = {
mappings = { i = { ['<esc>'] = actions.close } },
vimgrep_arguments = {
'rg',
'--pretty',
'--with-filename',
'--column',
'--smart-case',
},
prompt_position = 'bottom',
prompt_prefix = '>',
initial_mode = 'insert',
selection_strategy = 'reset',
sorting_strategy = 'descending',
layout_strategy = 'horizontal',
layout_defaults = {
-- TODO add builtin options.
},
file_sorter = require('telescope.sorters').get_fuzzy_file,
file_ignore_patterns = {},
generic_sorter = require('telescope.sorters').get_generic_fuzzy_sorter,
shorten_path = true,
winblend = 0,
width = 0.75,
preview_cutoff = 80,
results_height = 1,
results_width = 0.8,
border = {},
borderchars = { '', '', '', '', '', '', '', '' },
color_devicons = true,
use_less = true,
set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil,
file_previewer = require('telescope.previewers').vim_buffer_cat.new,
grep_previewer = require('telescope.previewers').vim_buffer_vimgrep.new,
qflist_previewer = require('telescope.previewers').vim_buffer_qflist.new,
-- Developer configurations: Not meant for general override
buffer_previewer_maker = require('telescope.previewers').buffer_previewer_maker,
},
})

20
lua/plugins/configs/nvim-toggleterm.lua

@ -0,0 +1,20 @@
require('toggleterm').setup({
size = g.doom_terminal_height,
open_mapping = [[<c-t>]],
hide_numbers = true,
shade_filetypes = {},
shade_terminals = true,
start_in_insert = true,
persist_size = true,
direction = g.doom_terminal_direction,
float_opts = {
border = 'curved',
width = g.doom_terminal_width,
height = g.doom_terminal_height,
winblend = 0,
highlights = {
border = 'Special',
background = 'Normal',
},
},
})

96
lua/configs/nvim-tree.lua → lua/plugins/configs/nvim-tree.lua

@ -1,4 +1,4 @@
local tree_cb = require'nvim-tree.config'.nvim_tree_callback
local tree_cb = require('nvim-tree.config').nvim_tree_callback
-- Empty by default
vim.g.nvim_tree_ignore = { '.git', 'node_modules', '.cache', '__pycache__' }
@ -28,62 +28,58 @@ vim.g.nvim_tree_group_empty = 1
-- If false, do not show the icons for one of 'git' 'folder' and 'files'
-- true by default, notice that if 'files' is 1, it will only display
-- if nvim-web-devicons is installed and on your runtimepath
vim.g.nvim_tree_show_icons = {
git = 1,
folders = 1,
files = 1,
}
vim.g.nvim_tree_show_icons = { git = 1, folders = 1, files = 1 }
-- You can edit keybindings be defining this variable
-- You don't have to define all keys.
-- NOTE: the 'edit' key will wrap/unwrap a folder and open a file
vim.g.nvim_tree_bindings = {
-- default mappings
["<CR>"] = tree_cb("edit"),
["o"] = tree_cb("edit"),
["<2-LeftMouse>"] = tree_cb("edit"),
["<CR>"] = tree_cb("cd"),
["<2-RightMouse>"] = tree_cb("cd"),
["<C-]>"] = tree_cb("cd"),
["<C-v>"] = tree_cb("vsplit"),
["<C-x>"] = tree_cb("split"),
["<C-t>"] = tree_cb("tabnew"),
["<BS>"] = tree_cb("close_node"),
["<S-CR>"] = tree_cb("close_node"),
["<Tab>"] = tree_cb("preview"),
["I"] = tree_cb("toggle_ignored"),
["H"] = tree_cb("toggle_dotfiles"),
["R"] = tree_cb("refresh"),
["a"] = tree_cb("create"),
["d"] = tree_cb("remove"),
["r"] = tree_cb("rename"),
["<C-r>"] = tree_cb("full_rename"),
["x"] = tree_cb("cut"),
["c"] = tree_cb("copy"),
["p"] = tree_cb("paste"),
["[c"] = tree_cb("prev_git_item"),
["]c"] = tree_cb("next_git_item"),
["-"] = tree_cb("dir_up"),
["q"] = tree_cb("close")
-- default mappings
['<CR>'] = tree_cb('edit'),
['o'] = tree_cb('edit'),
['<2-LeftMouse>'] = tree_cb('edit'),
['<CR>'] = tree_cb('cd'),
['<2-RightMouse>'] = tree_cb('cd'),
['<C-]>'] = tree_cb('cd'),
['<C-v>'] = tree_cb('vsplit'),
['<C-x>'] = tree_cb('split'),
['<C-t>'] = tree_cb('tabnew'),
['<BS>'] = tree_cb('close_node'),
['<S-CR>'] = tree_cb('close_node'),
['<Tab>'] = tree_cb('preview'),
['I'] = tree_cb('toggle_ignored'),
['H'] = tree_cb('toggle_dotfiles'),
['R'] = tree_cb('refresh'),
['a'] = tree_cb('create'),
['d'] = tree_cb('remove'),
['r'] = tree_cb('rename'),
['<C-r>'] = tree_cb('full_rename'),
['x'] = tree_cb('cut'),
['c'] = tree_cb('copy'),
['p'] = tree_cb('paste'),
['[c'] = tree_cb('prev_git_item'),
[']c'] = tree_cb('next_git_item'),
['-'] = tree_cb('dir_up'),
['q'] = tree_cb('close'),
}
-- default will show icon by default if no icon is provided
-- default shows no icon by default
vim.g.nvim_tree_icons = {
default = "",
symlink = "",
git = {
unstaged = "",
staged = "",
unmerged = "",
renamed = "",
untracked = ""
},
folder = {
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
symlink_open = "",
}
default = '',
symlink = '',
git = {
unstaged = '',
staged = '',
unmerged = '',
renamed = '',
untracked = '',
},
folder = {
default = '',
open = '',
empty = '',
empty_open = '',
symlink = '',
symlink_open = '',
},
}

42
lua/plugins/configs/nvim-zen.lua

@ -0,0 +1,42 @@
require('true-zen').setup({
true_false_commands = false,
cursor_by_mode = false,
before_minimalist_mode_shown = false,
before_minimalist_mode_hidden = false,
after_minimalist_mode_shown = false,
after_minimalist_mode_hidden = false,
bottom = {
hidden_laststatus = 0,
hidden_ruler = false,
hidden_showmode = false,
hidden_showcmd = false,
hidden_cmdheight = 1,
shown_laststatus = 2,
shown_ruler = true,
shown_showmode = false,
shown_showcmd = false,
shown_cmdheight = 1,
},
top = { hidden_showtabline = 0, shown_showtabline = 2 },
left = {
hidden_number = false,
hidden_relativenumber = false,
hidden_signcolumn = 'no',
shown_number = true,
shown_relativenumber = false,
shown_signcolumn = 'no',
},
ataraxis = {
just_do_it_for_me = true,
left_padding = 40,
right_padding = 40,
top_padding = 0,
bottom_padding = 0,
custome_bg = '',
disable_bg_configuration = true,
},
focus = { margin_of_error = 5 },
integrations = { integration_galaxyline = true },
})

226
lua/plugins/configs/statusline.lua

@ -0,0 +1,226 @@
-- Extracted from https://github.com/glepnir/galaxyline.nvim/blob/main/example/eviline.lua
-- Credits goes to its author (glepnir) :)
local gl = require('galaxyline')
local colors = require('galaxyline.theme').default
local condition = require('galaxyline.condition')
local gls = gl.section
gl.short_line_list = { 'NvimTree', 'vista', 'dbui', 'packer' }
gls.left[1] = {
RainbowRed = {
provider = function()
return ''
end,
highlight = { colors.blue, colors.bg },
},
}
gls.left[2] = {
ViMode = {
provider = function()
-- auto change color according the vim mode
local mode_color = {
n = colors.red,
i = colors.green,
v = colors.blue,
[''] = colors.blue,
V = colors.blue,
c = colors.magenta,
no = colors.red,
s = colors.orange,
S = colors.orange,
[''] = colors.orange,
ic = colors.yellow,
R = colors.violet,
Rv = colors.violet,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.red,
t = colors.red,
}
vim.api.nvim_command(
'hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()]
)
return ''
end,
highlight = { colors.red, colors.bg, 'bold' },
},
}
gls.left[3] = {
FileSize = {
provider = 'FileSize',
condition = condition.buffer_not_empty,
highlight = { colors.fg, colors.bg },
},
}
gls.left[4] = {
FileIcon = {
provider = 'FileIcon',
condition = condition.buffer_not_empty,
highlight = {
require('galaxyline.provider_fileinfo').get_file_icon_color,
colors.bg,
},
},
}
gls.left[5] = {
FileName = {
provider = 'FileName',
condition = condition.buffer_not_empty,
highlight = { colors.magenta, colors.bg, 'bold' },
},
}
gls.left[6] = {
LineInfo = {
provider = 'LineColumn',
separator = ' ',
separator_highlight = { 'NONE', colors.bg },
highlight = { colors.fg, colors.bg },
},
}
gls.left[7] = {
PerCent = {
provider = 'LinePercent',
separator = ' ',
separator_highlight = { 'NONE', colors.bg },
highlight = { colors.fg, colors.bg, 'bold' },
},
}
gls.left[8] = {
DiagnosticError = {
provider = 'DiagnosticError',
icon = '',
highlight = { colors.red, colors.bg },
},
}
gls.left[9] = {
DiagnosticWarn = {
provider = 'DiagnosticWarn',
icon = '',
highlight = { colors.yellow, colors.bg },
},
}
gls.left[10] = {
DiagnosticHint = {
provider = 'DiagnosticHint',
icon = '',
highlight = { colors.cyan, colors.bg },
},
}
gls.left[11] = {
DiagnosticInfo = {
provider = 'DiagnosticInfo',
icon = '',
highlight = { colors.blue, colors.bg },
},
}
gls.mid[1] = {
ShowLspClient = {
provider = 'GetLspClient',
condition = function()
local tbl = { ['dashboard'] = true, [''] = true }
if tbl[vim.bo.filetype] then
return false
end
return true
end,
icon = ' LSP: ',
highlight = { colors.cyan, colors.bg, 'bold' },
},
}
gls.right[1] = {
FileEncode = {
provider = 'FileEncode',
condition = condition.hide_in_width,
separator = ' ',
separator_highlight = { 'NONE', colors.bg },
highlight = { colors.green, colors.bg, 'bold' },
},
}
gls.right[2] = {
FileFormat = {
provider = 'FileFormat',
condition = condition.hide_in_width,
separator = ' ',
separator_highlight = { 'NONE', colors.bg },
highlight = { colors.green, colors.bg, 'bold' },
},
}
gls.right[3] = {
GitIcon = {
provider = function()
return ''
end,
condition = condition.check_git_workspace,
separator = ' ',
separator_highlight = { 'NONE', colors.bg },
highlight = { colors.violet, colors.bg, 'bold' },
},
}
gls.right[4] = {
GitBranch = {
provider = 'GitBranch',
condition = condition.check_git_workspace,
highlight = { colors.violet, colors.bg, 'bold' },
},
}
gls.right[5] = {
DiffAdd = {
provider = 'DiffAdd',
condition = condition.hide_in_width,
icon = '',
highlight = { colors.green, colors.bg },
},
}
gls.right[6] = {
DiffModified = {
provider = 'DiffModified',
condition = condition.hide_in_width,
icon = '',
highlight = { colors.orange, colors.bg },
},
}
gls.right[7] = {
DiffRemove = {
provider = 'DiffRemove',
condition = condition.hide_in_width,
icon = '',
highlight = { colors.red, colors.bg },
},
}
gls.right[8] = {
RainbowBlue = {
provider = function()
return ''
end,
highlight = { colors.blue, colors.bg },
},
}
gls.short_line_left[1] = {
BufferType = {
provider = 'FileTypeName',
separator = ' ',
separator_highlight = { 'NONE', colors.bg },
highlight = { colors.blue, colors.bg, 'bold' },
},
}
gls.short_line_left[2] = {
SFileName = {
provider = 'SFileName',
condition = condition.buffer_not_empty,
highlight = { colors.fg, colors.bg, 'bold' },
},
}
gls.short_line_right[1] = {
BufferIcon = {
provider = 'BufferIcon',
highlight = { colors.fg, colors.bg },
},
}

14
lua/plugins/configs/symbols.lua

@ -0,0 +1,14 @@
g.symbols_outline = {
highlight_hovered_item = true,
show_guides = true,
position = 'left',
keymaps = {
close = '<Esc>',
goto_location = '<CR>',
focus_location = 'o',
hover_symbol = '<C-space>',
rename_symbol = 'r',
code_actions = 'a',
},
lsp_blacklist = {},
}

11
lua/configs/tree-sitter.lua → lua/plugins/configs/tree-sitter.lua

@ -4,8 +4,9 @@ local ts = require('nvim-treesitter.configs')
maintained languages modules instead of a list of languages. You also need to
set highlight to true, otherwise the plugin will be disabled.
--]]
ts.setup {
-- NOTE: Place your languages here!
ensure_installed = vim.g.doom_ts_parsers,
highlight = { enabled = true }
}
ts.setup({
-- NOTE: Place your languages here!
ensure_installed = vim.g.doom_ts_parsers,
highlight = { enabled = true },
indent = { enabled = true },
})

30
lua/plugins/configs/which-key.lua

@ -0,0 +1,30 @@
require('which-key').setup({
plugins = { marks = false, registers = false },
presets = {
operators = false,
motions = false,
text_objects = false,
windows = false,
nav = false,
z = false,
g = false,
},
icons = {
breadcrumb = '»', -- symbol used in the command line area that shows your active key combo
separator = '', -- symbol used between a key and it's label
group = '+', -- symbol prepended to a group
},
window = {
border = 'none', -- none, single, double, shadow
position = 'bottom', -- bottom, top
margin = { 1, 0, 0, 0 }, -- extra window margin [top, right, bottom, left]
padding = { 1, 1, 1, 1 }, -- extra window padding [top, right, bottom, left]
},
layout = {
height = { min = 4, max = 25 }, -- min and max height of the columns
width = { min = 20, max = 50 }, -- min and max width of the columns
spacing = 3, -- spacing between columns
},
hidden = { '<silent>', '^:', '^ ' }, -- hide mapping boilerplate
show_help = true, -- show help message on the command line when the popup is visible
})

374
lua/plugins/init.lua

@ -0,0 +1,374 @@
-- Manage vim global variables
local nvim_set_var = api.nvim_set_var
----- Plugins modules
-- Essentials / (Plugin manager, vimpeccable, treesitter, sessions)
-- UI Related / (All look-and-feel plugins)
-- Fuzzy Search ! (Fuzzy searching)
-- Git Integration + (Some git plugins like LazyGit)
-- Completion + (Built-in LSP configurations)
-- File-related + (EditorConfig, formatting, Tree-sitter, etc)
-- Web-related + (Colorizer, emmet, rest client)
--
-- Legend:
-- ! : The group and its plugins cannot be disabled
-- / : The group cannot be disabled but some of its plugins can be
-- + : The group and its plugins can be disabled
--
-- NOTES:
-- 1. You can disable an entire group or just some or their plugins based on
-- the legend, please refer to our documentation to learn how to do it.
-- 2. We do not provide other LSP integration like coc.nvim,
-- please refer to our FAQ to see why.
--- Set disabled plugins modules and plugins
local disabled_plugins = {}
--- Disabled modules
local disabled_git = has_value(g.doom_disabled_modules, 'git')
local disabled_lsp = has_value(g.doom_disabled_modules, 'lsp')
local disabled_files = has_value(g.doom_disabled_modules, 'files')
local disabled_web = has_value(g.doom_disabled_modules, 'web')
local packer = require('packer')
return packer.startup(function()
-----[[------------]]-----
--- Essentials ---
-----]]------------[[-----
-- Plugins manager
use('wbthomason/packer.nvim')
-- Auxiliar functions for using Lua in Neovim
use('svermeulen/vimpeccable')
-- Tree-Sitter
local disabled_treesitter =
has_value(g.doom_disabled_plugins, 'treesitter')
if disabled_files and not disabled_treesitter then
table.insert(disabled_plugins, 'treesitter')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate',
disable = (disabled_files and true or disabled_treesitter),
})
-- Sessions
use({
'rmagatti/auto-session',
requires = { 'rmagatti/session-lens' },
})
-----[[------------]]-----
--- UI Related ---
-----]]------------[[-----
-- Fancy start screen
-- cannot be disabled
use({ 'glepnir/dashboard-nvim', disabled = false })
-- Colorschemes
-- cannot be disabled at the moment
use({
'sainnhe/sonokai',
'sainnhe/edge',
'sainnhe/everforest',
'wadackel/vim-dogrun',
'joshdick/onedark.vim',
'ajmwagar/vim-deus',
})
-- File tree
local disabled_tree = has_value(g.doom_disabled_plugins, 'tree')
if disabled_tree then
table.insert(disabled_plugins, 'tree')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'kyazdani42/nvim-tree.lua',
requires = { 'kyazdani42/nvim-web-devicons' },
disabled = disabled_tree,
})
-- Statusline
-- can be disabled to use your own statusline
local disabled_statusline =
has_value(g.doom_disabled_plugins, 'statusline')
if disabled_statusline then
table.insert(disabled_plugins, 'statusline')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'glepnir/galaxyline.nvim',
disabled = disabled_statusline,
})
-- Tabline
-- can be disabled to use your own tabline
local disabled_tabline = has_value(g.doom_disabled_plugins, 'tabline')
if disabled_tabline then
table.insert(disabled_plugins, 'tabline')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({ 'romgrk/barbar.nvim', disabled = disabled_tabline })
-- Better splits
-- NOTE: we are using this specific branch because the main still does not have
-- the ignore filetypes feature, thanks to its owner per adding it <3
local disabled_focus = has_value(g.doom_disabled_plugins, 'focus')
if disabled_focus then
table.insert(disabled_plugins, 'focus')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'beauwilliams/focus.nvim',
branch = 'cust_filetypes',
disabled = disabled_focus,
})
-- Better terminal
-- can be disabled to use your own terminal plugin
local disabled_terminal = has_value(g.doom_disabled_plugins, 'terminal')
if disabled_terminal then
table.insert(disabled_plugins, 'terminal')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'akinsho/nvim-toggleterm.lua',
disabled = disabled_terminal,
})
-- Viewer & finder for LSP symbols and tags
local disabled_tagbar = has_value(g.doom_disabled_plugins, 'tagbar')
if disabled_tagbar then
table.insert(disabled_plugins, 'tagbar')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'simrat39/symbols-outline.nvim',
disabled = disabled_tagbar,
})
-- Minimap
-- Depends on wfxr/code-minimap to work!
local disabled_minimap = has_value(g.doom_disabled_plugins, 'minimap')
if disabled_minimap then
table.insert(disabled_plugins, 'minimap')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({ 'wfxr/minimap.vim', disabled = disabled_minimap })
-- Keybindings menu like Emacs's guide-key
-- cannot be disabled
use({ 'folke/which-key.nvim', disabled = false })
-- Distraction free environment
local disabled_zen = has_value(g.doom_disabled_plugins, 'zen')
if disabled_zen then
table.insert(disabled_plugins, 'zen')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({ 'kdav5758/TrueZen.nvim', disabled = disabled_zen })
-----[[--------------]]-----
--- Fuzzy Search ---
-----]]--------------[[-----
use({
'nvim-telescope/telescope.nvim',
requires = { { 'nvim-lua/popup.nvim' }, { 'nvim-lua/plenary.nvim' } },
disable = false,
})
-----[[-------------]]-----
--- GIT RELATED ---
-----]]-------------[[-----
-- Git gutter better alternative, written in Lua
-- can be disabled to use your own git gutter plugin
local disabled_gitsigns = has_value(g.doom_disabled_plugins, 'gitsigns')
if disabled_git and not disabled_gitsigns then
table.insert(disabled_plugins, 'gitsigns')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'lewis6991/gitsigns.nvim',
disable = (disabled_git and true or disabled_gitsigns),
})
-- LazyGit integration
local disabled_lazygit = has_value(g.doom_disabled_plugins, 'lazygit')
if disabled_git and not disabled_lazygit then
table.insert(disabled_plugins, 'lazygit')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'kdheepak/lazygit.nvim',
requires = { 'nvim-lua/plenary.nvim' },
disable = (disabled_git and true or disabled_lazygit),
})
-----[[------------]]-----
--- Completion ---
-----]]------------[[-----
-- Built-in LSP Config
-- NOTE: It should not be disabled if you are going to use LSP!
local disabled_lspconfig =
has_value(g.doom_disabled_plugins, 'lspconfig')
if disabled_lsp and not disabled_lspconfig then
table.insert(disabled_plugins, 'lspconfig')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'neovim/nvim-lspconfig',
disable = (disabled_completion and true or disabled_lspconfig),
})
-- Completion plugin
-- can be disabled to use your own completion plugin
local disabled_compe = has_value(g.doom_disabled_plugins, 'compe')
if disabled_lsp and not disabled_compe then
table.insert(disabled_plugins, 'compe')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'hrsh7th/nvim-compe',
requires = {
{ 'ray-x/lsp_signature.nvim' },
{ 'onsails/lspkind-nvim' },
{ 'norcalli/snippets.nvim' },
},
disable = (disabled_completion and true or disabled_compe),
})
-- provides the missing `:LspInstall` for `nvim-lspconfig`.
local disabled_lspinstall =
has_value(g.doom_disabled_plugins, 'lspinstall')
if disabled_lsp and not disabled_lspinstall then
table.insert(disabled_plugins, 'lspinstall')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use('kabouzeid/nvim-lspinstall')
-----[[--------------]]-----
--- File Related ---
-----]]--------------[[-----
-- Write / Read files without permissions (e.g. /etc files) without having
-- to use `sudo nvim /path/to/file`
local disabled_suda = has_value(g.doom_disabled_plugins, 'suda')
if disabled_files and not disabled_suda then
table.insert(disabled_plugins, 'suda')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'lambdalisue/suda.vim',
disable = (disabled_files and true or disabled_suda),
})
-- File formatting
-- can be disabled to use your own file formatter
local disabled_formatter =
has_value(g.doom_disabled_plugins, 'formatter')
if disabled_files and not disabled_formatter then
table.insert(disabled_plugins, 'formatter')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'lukas-reineke/format.nvim',
disable = (disabled_files and true or disabled_formatter),
})
-- Autopairs
-- can be disabled to use your own autopairs
local disabled_autopairs =
has_value(g.doom_disabled_plugins, 'autopairs')
if disabled_files and not disabled_autopairs then
table.insert(disabled_plugins, 'autopairs')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'steelsojka/pears.nvim',
disable = (disabled_files and true or disabled_autopairs),
})
-- Indent Lines
local disabled_indent_lines =
has_value(g.doom_disabled_plugins, 'indentlines')
if disabled_files and not disabled_indent_lines then
table.insert(disabled_plugins, 'indentlines')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'Yggdroot/indentLine',
disable = (disabled_files and true or disabled_indent_lines),
})
-- EditorConfig support
local disabled_editorconfig =
has_value(g.doom_disabled_plugins, 'editorconfig')
if disabled_files and not disabled_editorconfig then
table.insert(disabled_plugins, 'editorconfig')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'editorconfig/editorconfig-vim',
disable = (disabled_files and true or disabled_editorconfig),
})
-- Comments
-- can be disabled to use your own comments plugin
local disabled_kommentary =
has_value(g.doom_disabled_plugins, 'kommentary')
if disabled_files and not disabled_kommentary then
table.insert(disabled_plugins, 'kommentary')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'b3nj5m1n/kommentary',
disable = (disabled_files and true or disabled_kommentary),
})
-----[[-------------]]-----
--- Web Related ---
-----]]-------------[[-----
-- Fastest colorizer without external dependencies!
local disabled_colorizer =
has_value(g.doom_disabled_plugins, 'colorizer')
if disabled_web and not disabled_colorizer then
table.insert(disabled_plugins, 'colorizer')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'norcalli/nvim-colorizer.lua',
disable = (disabled_web and true or disabled_colorizer),
})
-- HTTP Client support
-- Depends on bayne/dot-http to work!
local disabled_restclient =
has_value(g.doom_disabled_plugins, 'restclient')
if disabled_web and not disabled_restclient then
table.insert(disabled_plugins, 'restclient')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'bayne/vim-dot-http',
disable = (disabled_web and true or disabled_restclient),
})
-- Emmet plugin
local disabled_emmet = has_value(g.doom_disabled_plugins, 'emmet')
if disabled_web and not disabled_emmet then
table.insert(disabled_plugins, 'emmet')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use({
'mattn/emmet-vim',
disable = (disabled_web and true or disabled_emmet),
})
-----[[----------------]]-----
--- Custom Plugins ---
-----]]----------------[[-----
-- If there are custom plugins then also require them
for _, plug in pairs(g.doom_custom_plugins) do
custom_plugins(plug)
end
end)
Loading…
Cancel
Save