NTBBloodbath
4 years ago
committed by
GitHub
55 changed files with 2473 additions and 1641 deletions
@ -1 +1,4 @@ |
|||
# My temp files |
|||
logs/ |
|||
plugin/ |
|||
sessions/ |
|||
|
@ -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 |
@ -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 |
@ -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 |
@ -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> |
@ -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 |
@ -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", |
|||
\} |
@ -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') |
@ -1,7 +0,0 @@ |
|||
"================================================ |
|||
" init.lua - Init file of Doom Nvim |
|||
" Author: NTBBloodbath |
|||
" License: MIT |
|||
"================================================ |
|||
|
|||
execute 'source' fnamemodify(expand('<sfile>'), ':h').'/config/main.vim' |
@ -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 |
@ -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 |
|||
} |
@ -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; |
|||
}; |
|||
} |
@ -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 |
|||
} |
@ -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 |
|||
} |
|||
} |
@ -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', |
|||
} |
@ -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} |
|||
} |
|||
} |
@ -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 |
@ -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']() |
@ -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 |
@ -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 |
|||
|
@ -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 |
@ -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 |
@ -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) |
@ -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,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 |
@ -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 |
|||
}) |
@ -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, |
|||
}, |
|||
}) |
@ -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' }, |
|||
}, |
|||
}, |
|||
}) |
@ -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 |
|||
}) |
@ -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) |
@ -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, |
|||
}, |
|||
}) |
@ -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', |
|||
}, |
|||
}, |
|||
}) |
@ -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 }, |
|||
}) |
@ -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 }, |
|||
}, |
|||
} |
@ -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 = {}, |
|||
} |
@ -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 |
|||
}) |
@ -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…
Reference in new issue