Browse Source

Big improvements, more stability

my-config
NTBBloodbath 4 years ago
parent
commit
db7f0e1a1b
No known key found for this signature in database GPG Key ID: 18D6730BC846AAC5
  1. 14
      autoload/doom.vim
  2. 177
      config/keybindings.vim
  3. 271
      config/plugins/leader-mapper.vim
  4. 188
      lua/plugins.lua

14
autoload/doom.vim

@ -76,8 +76,8 @@ let g:doom_disabled_plugins = []
" Disabled plugins groups
" @default = ['git', 'lsp', 'web']
" example:
" let g:doom_disabled_plugins_group = ['web']
let g:doom_disabled_plugins_group = ['git', 'lsp', 'web']
" let g:doom_disabled_plugins_groups = ['web']
let g:doom_disabled_plugins_groups = ['git', 'lsp', 'web']
" Install custom plugins
" @default = []
@ -147,9 +147,13 @@ function! doom#end() abort
call doom#system#grepconfig('config', 'gui.vim', 1)
call doom#system#grepconfig('config', 'keybindings.vim', 1)
" Plugins
call doom#system#grepconfig('config/plugins/', 'vista.vim', 1)
call doom#system#grepconfig('config/plugins/', 'neoformat.vim', 1)
" Plugins, configs are loaded only if the plugin is enabled.
if index(g:doom_disabled_plugins, 'vista') == -1
call doom#system#grepconfig('config/plugins/', 'vista.vim', 1)
endif
if index(g:doom_disabled_plugins, 'neoformat') == -1
call doom#system#grepconfig('config/plugins/', 'neoformat.vim', 1)
endif
call doom#system#grepconfig('config/plugins/', 'leader-mapper.vim', 1)
" Check updates

177
config/keybindings.vim

@ -33,148 +33,16 @@ let g:mapleader = " "
"==========================="
" LSP Keybindings "
"==========================="
" 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 })
"==========================="
" Leader Keybindings "
"==========================="
" - LSP Menu
" Show type definition
nnoremap <leader>lD <cmd>lua vim.lsp.buf.type_definition()<CR>
" Show line diagnostics
nnoremap <leader>le <cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>
" Diagnostics into location list
nnoremap <leader>lq <cmd>lua vim.lsp.diagnostic.set_loclist()<CR>
" - Git Menu
" Open LazyGit
nnoremap <leader>go :LazyGit
" Pull
nnoremap <leader>gP :TermExec git pull<CR>
" Push
nnoremap <leader>gp :TermExec git push<CR>
" Status
nnoremap <leader>gs :TermExec git status<CR>
" - Plugins Menu
" Clean disabled or unused plugins
nnoremap <leader>pc :PackerClean<CR>
" Install missing plugins
nnoremap <leader>pi :PackerInstall<CR>
" Performs PackerClean and then PackerUpdate
nnoremap <leader>ps :PackerSync<CR>
" Update your plugins
nnoremap <leader>pu :PackerUpdate<CR>
" - Buffer Menu
" Go to buffer 1
nnoremap <leader>b1 :BufferGoto 1<CR>
" Go to buffer 2
nnoremap <leader>b2 :BufferGoto 2<CR>
" Go to buffer 3
nnoremap <leader>b3 :BufferGoto 3<CR>
" Go to buffer 4
nnoremap <leader>b4 :BufferGoto 4<CR>
" Go to buffer 5
nnoremap <leader>b5 :BufferGoto 5<CR>
" Go to buffer 6
nnoremap <leader>b6 :BufferGoto 6<CR>
" Go to buffer 7
nnoremap <leader>b7 :BufferGoto 7<CR>
" Go to buffer 8
nnoremap <leader>b8 :BufferGoto 8<CR>
" Go to last buffer
nnoremap <leader>b9 :BufferLast<CR>
" Close current buffer
nnoremap <leader>bc :BufferClose<CR>
" Format buffer
nnoremap <leader>bf :Neoformat<CR>
" Next buffer
nnoremap <leader>bn :BufferNext<CR>
" Pick buffer
nnoremap <leader>bP :BufferPick<CR>
" Previous buffer
nnoremap <leader>bp :BufferPrevious<CR>
" - Order buffer menu
" Sort by directory
nnoremap <leader>od :BufferOrderByDirectory<CR>
" Sort by language
nnoremap <leader>ol :BufferOrderByLanguage<CR>
" Re-order buffer to next
nnoremap <leader>on :BufferMoveNext<CR>
" Re-order buffer to previous
nnoremap <leader>op :BufferMovePrevious<CR>
" - File Menu
" Bookmarks
nnoremap <leader>fb :Telescope marks<CR>
" Edit Neovim configuration
nnoremap <leader>fc :e $MYVIMRC<CR>
" Find file
nnoremap <leader>ff :Telescope find_files<CR>
" Find word
nnoremap <leader>fg :Telescope live_grep<CR>
" Help tags
nnoremap <leader>ft :Telescope help_tags<CR>
" Write file with sudo permissions (For unwritable files)
nnoremap <leader>fw :SudaWrite<CR>
" Re-open file with sudo permissions (For unreadable files only!)
nnoremap <leader>fr :SudaRead<CR>
" Override existing telescope <leader>fh mapping
autocmd VimEnter * noremap <leader>fh :Telescope oldfiles<CR>
" Recently opened files
nnoremap <leader>fh :Telescope oldfiles<CR>
" Create a new unnamed buffer
nnoremap <leader>fn :new<CR>
" - Window Menu
" Close all other windows
nnoremap <leader>wC :only<CR>
" Close current window
nnoremap <leader>wc :close<CR>
" Split horizontally
nnoremap <leader>wh :split<CR>
" Split vertically
nnoremap <leader>wv :vsplit<CR>
" - Runner Menu
" Run dot-http on the line that the cursor is currently on
nnoremap <leader>rh :DotHttp<CR>
" - Session Menu
" Save session
nmap <leader>ss :<C-u>SessionSave<CR>
" Load session
nmap <leader>sl :<C-u>SessionLoad<CR>
" ToggleTerm custom function to avoid having
" line numbers inside the terminal buffer
" because that is not from God.
function ToggleTerm()
execute "ToggleTerm"
set nonumber norelativenumber
endfunction
" Toggle Menu
" Change colorscheme
nnoremap <leader>tc :DashboardChangeColorscheme<CR>
" Toggle Tree Explorer
nnoremap <leader>te :NvimTreeToggle<CR>
" Toggle Minimap
nnoremap <leader>tm :MinimapToggle<CR>
" Toggle Line Numbers
nnoremap <leader>tn :set number! relativenumber!<CR>
" Open start screen
nnoremap <leader>ts :Dashboard<CR>
" Toggle Tags view
nnoremap <leader>tT :Vista!!<CR>
" Open a new terminal
nnoremap <leader>tt :call ToggleTerm()<CR>
" If the LSP group is not disabled or the nvim-compe plugin is not disabled
" then set its mappings.
if index(g:doom_disabled_plugins_groups, '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>
@ -184,11 +52,20 @@ nnoremap <silent><S-Tab> :bprevious<CR>
nnoremap <silent><esc> :noh<CR>
" F<N> keybindings
nnoremap <F2> :Vista!!<CR>
nnoremap <F3> :NvimTreeToggle<CR>
nnoremap <F4> :MinimapToggle<CR>
nnoremap <F5> :Goyo<CR>
nnoremap <F6> :DotHttp<CR>
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>
if index(g:doom_disabled_plugins, 'minimap') == -1
nnoremap <F4> :MinimapToggle<CR>
endif
if index(g:doom_disabled_plugins, 'goyo') == -1
nnoremap <F5> :Goyo<CR>
endif
if index(g:doom_disabled_plugins_groups, 'web') == -1
nnoremap <F6> :DotHttp<CR>
endif
"====================="
" Disable keys "
@ -205,5 +82,7 @@ nnoremap q <Nop>
" Fast exit from Doom Nvim
nnoremap ZZ :call doom#functions#quit_doom(1,1)<CR>
" Set-up vim_buffer_ previewer
autocmd User TelescopePreviewerLoaded setlocal wrap
if index(g:doom_disabled_plugins_groups, 'fuzzy') == -1 || index(g:doom_disabled_plugins, 'telescope') == -1
" Set-up vim_buffer_ previewer
autocmd User TelescopePreviewerLoaded setlocal wrap
endif

271
config/plugins/leader-mapper.vim

@ -2,87 +2,232 @@
let g:lmap = {}
" LSP Menu
let g:lmap.l = {"name": "LSP Menu"}
let g:lmap.l.D = "Show type definition"
let g:lmap.l.e = "Show line diagnostics"
let g:lmap.l.q = "Diagnostics into location list"
if index(g:doom_disabled_plugins_groups, '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
let g:lmap.g = {"name": "Git Menu"}
let g:lmap.g.o = "Open LazyGit"
let g:lmap.g.P = "Pull"
let g:lmap.g.p = "Push"
let g:lmap.g.s = "Status"
if index(g:doom_disabled_plugins_groups, 'git') == -1 && index(g:doom_disabled_plugins, 'lazygit') == -1 ||
\ index(g:doom_disabled_plugins_groups, 'git') == -1 && index(g:doom_disabled_plugins, 'toggleterm') == -1
let g:lmap.g = {'name': 'Git Menu'}
if index(g:doom_disabled_plugins, 'lazygit') == -1
" Open LazyGit
nnoremap <leader>go :LazyGit
let g:lmap.g.o = 'Open LazyGit'
endif
if index(g:doom_disabled_plugins, 'toggleterm') == -1
" Pull
nnoremap <leader>gP :TermExec git pull<CR>
let g:lmap.g.P = 'Pull'
" Push
nnoremap <leader>gp :TermExec git push<CR>
let g:lmap.g.p = 'Push'
" Status
nnoremap <leader>gs :TermExec git status<CR>
let g:lmap.g.s = 'Status'
endif
endif
" Plugin Menu
let g:lmap.p = {"name": "Plugin Menu"}
let g:lmap.p.c = "Clean disabled or unused plugins"
let g:lmap.p.i = "Install missing plugins"
let g:lmap.p.s = "Performs PackerClean and then PackerUpdate"
let g:lmap.p.u = "Update your plugins"
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"}
let g:lmap.b.1 = "Buffer 1"
let g:lmap.b.2 = "Buffer 2"
let g:lmap.b.3 = "Buffer 3"
let g:lmap.b.4 = "Buffer 4"
let g:lmap.b.5 = "Buffer 5"
let g:lmap.b.6 = "Buffer 6"
let g:lmap.b.7 = "Buffer 7"
let g:lmap.b.8 = "Buffer 8"
let g:lmap.b.9 = "Last buffer"
let g:lmap.b.c = "Close buffer"
let g:lmap.b.f = "Format buffer"
let g:lmap.b.n = "Next buffer"
let g:lmap.b.P = "Pick buffer"
let g:lmap.b.p = "Previous buffer"
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"}
let g:lmap.o.d = "Sort by directory"
let g:lmap.o.l = "Sort by language"
let g:lmap.o.n = "Re-order buffer to next"
let g:lmap.o.p = "Re-order buffer to previous"
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"}
let g:lmap.f.b = "Bookmarks"
let g:lmap.f.c = "Edit Neovim configuration"
let g:lmap.f.f = "Find file"
let g:lmap.f.g = "Find word"
let g:lmap.f.t = "Help Tags"
let g:lmap.f.w = "Write file with sudo permissions (For unwritable files)"
let g:lmap.f.r = "Re-open file with sudo permissions (For unreadable files only!)"
let g:lmap.f.h = "Recently opened files"
let g:lmap.f.n = "Create a new unnamed buffer"
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"}
let g:lmap.w.C = "Close all other windows"
let g:lmap.w.c = "Close current window"
let g:lmap.w.h = "Split horizontally"
let g:lmap.w.v = "Split vertically"
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
let g:lmap.r = {"name": "Runner Menu"}
let g:lmap.r.h = "Run dot-http on the line that the cursor is currently on"
if index(g:doom_disabled_plugins_groups, '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"}
let g:lmap.s.s = "Save session"
let g:lmap.s.l = "Load session"
let g:lmap.s = {'name': 'Session Menu'}
" Save session
nmap <leader>ss :<C-u>SessionSave<CR>
let g:lmap.s.s = 'Save session'
" Load session
nmap <leader>sl :<C-u>SessionLoad<CR>
let g:lmap.s.l = 'Load session'
" ToggleNumbers function,
function ToggleNumbers()
if g:doom_relative_num ==# 1
set number! relativenumber!
else
set number!
endif
endfunction
" ToggleTerm custom function to avoid having
" line numbers inside the terminal buffer
" because that is not from God.
function ToggleTerm()
execute "ToggleTerm"
set nonumber norelativenumber
endfunction
" Toggle Menu
let g:lmap.t = {"name": "Toggler Menu"}
let g:lmap.t.c = "Change colorscheme"
let g:lmap.t.e = "Toggle Tree Explorer"
let g:lmap.t.m = "Toggle Minimap"
let g:lmap.t.n = "Toggle Line Numbers"
let g:lmap.t.q = "Auto toggle nvim-bqf"
let g:lmap.t.s = "Open start screen"
let g:lmap.t.T = "Toggle Tags view"
let g:lmap.t.t = "Toggle terminal"
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 ToggleTerm()<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

188
lua/plugins.lua

@ -1,5 +1,6 @@
-- Manage vim global variables
g = vim.g
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)
@ -12,18 +13,27 @@ function has_value(tabl, val)
return false
end
--- Set disabled plugins groups and plugins
disabled_plugins = {}
--- Disabled groups
disabled_fuzzy = has_value(g.doom_disabled_plugins_groups, 'fuzzy')
disabled_git = has_value(g.doom_disabled_plugins_groups, 'git')
disabled_completion = has_value(g.doom_disabled_plugins_groups, 'lsp')
disabled_files = has_value(g.doom_disabled_plugins_groups, 'files')
disabled_web = has_value(g.doom_disabled_plugins_groups, 'web')
-- Required if you have packer in your `opt` pack
-- /home/user/.local/share/nvim/site/pack/packer/opt
vim.cmd [[packadd packer.nvim]]
----- Plugins groups
-- Essentials, ! cannot be disabled (Plugin manager, vimpeccable and languages)
-- UI Related, / can be disabled (All look-and-feel plugins)
-- Fuzzy Search, + can be disabled (Fuzzy search & more)
-- Git Integration, + can be disabled (Some git plugins, including LazyGit)
-- Completion, + can be disabled (Built-in LSP configurations)
-- File-related, + can be disabled (EditorConfig, formatting, Tree-sitter, etc)
-- Web-related, + can be disabled (Colorizer, emmet, http client)
-- 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
@ -66,49 +76,84 @@ return require('packer').startup(function()
'joshdick/onedark.vim'
}
-- File tree
-- do not use the latest commit because it is broken, at least for me
-- do not use the latest commit because it is broken, at least for me
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' },
commit = '491fd68d62cebd4a07642cc052028d9d3b55f62e',
disabled = has_value(g.doom_disabled_plugins, 'nvim-tree.lua')
disabled = disabled_tree
}
-- Statusline
-- can be disabled to use your own statusline
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 = has_value(g.doom_disabled_plugins, 'galaxyline.nvim')
disabled = disabled_statusline
}
-- Tabline
-- can be disabled to use your own tabline
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 = has_value(g.doom_disabled_plugins, '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
-- the ignore filetypes feature, thanks to its owner per adding it <3
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 = has_value(g.doom_disabled_plugins, 'focus.nvim')
disabled = disabled_focus
}
-- Better terminal
-- can be disabled to use your own terminal plugin
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 = has_value(g.doom_disabled_plugins, 'nvim-toggleterm.lua')
disabled = disabled_terminal
}
-- Viewer & finder for LSP symbols and tags
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 = has_value(g.doom_disabled_plugins, 'vista.vim')
disabled = disabled_tagbar
}
-- Minimap
-- Depends on wfxr/code-minimap to work!
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 = has_value(g.doom_disabled_plugins, 'minimap.vim')
disabled = disabled_minimap
}
-- Keybindings menu like Emacs's guide-key
-- cannot be disabled
@ -117,115 +162,186 @@ return require('packer').startup(function()
disabled = false
}
-- Distraction free environment
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 = has_value(g.doom_disabled_plugins, 'goyo.vim')
disabled = disabled_goyo
}
-----[[--------------]]-----
--- Fuzzy Search ---
-----]]--------------[[-----
disabled_fuzzy = has_value(g.doom_disabled_plugins_group, 'fuzzy')
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 has_value(g.doom_disabled_plugins, 'telescope.nvim'))
disable = (disabled_fuzzy and true or disabled_telescope)
}
-----[[-------------]]-----
--- GIT RELATED ---
-----]]-------------[[-----
disabled_git = has_value(g.doom_disabled_plugins_group, 'git')
-- Git gutter better alternative
-- can be disabled to use your own git gutter plugin
disabled_signify = has_value(g.doom_disabled_plugins, 'signify')
if disabled_git and (not disabled_signify) then
table.insert(disabled_plugins, 'signify')
nvim_set_var('doom_disabled_plugins', disabled_plugins)
end
use {
'mhinz/vim-signify',
disable = (disabled_git and true or has_value(g.doom_disabled_plugins, 'vim-signify'))
disable = (disabled_git and true or disabled_signify)
}
-- LazyGit integration
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',
disable = disabled_git and true or has_value(g.doom_disabled_plugins, 'lazygit.nvim')
disable = (disabled_git and true or disabled_lazygit)
}
-----[[------------]]-----
--- Completion ---
-----]]------------[[-----
disabled_completion = has_value(g.doom_disabled_plugins_group, 'lsp')
-- Built-in LSP Config
-- NOTE: It should not be disabled if you are going to use LSP!
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',
commit = '11a581d1860a7ad2b6c1ee1e0ebbb000e81b9950',
disable = (disabled_completion and true or has_value(g.doom_disabled_plugins, 'nvim-lspconfig'))
disable = (disabled_completion and true or disabled_lspconfig)
}
-- Completion plugin
-- can be disabled to use your own completion plugin
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 has_value(g.doom_disabled_plugins, 'nvim-compe'))
disable = (disabled_completion and true or disabled_compe)
}
-----[[--------------]]-----
--- File Related ---
-----]]--------------[[-----
disabled_files = has_value(g.doom_disabled_plugins_group, 'files')
-- Write / Read files without permissions (e.g. /etc files) without having to use `sudo nvim /path/to/file`
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 has_value(g.doom_disabled_plugins, 'suda.vim'))
disable = (disabled_files and true or disabled_suda)
}
-- File formatting
-- can be disabled to use your own file formatter
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 has_value(g.doom_disabled_plugins, 'neoformat'))
disable = (disabled_files and true or disabled_neoformat)
}
-- Autopairs
-- can be disabled to use your own autopairs
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 has_value(g.doom_disabled_plugins, 'nvim-autopairs'))
disable = (disabled_files and true or disabled_autopairs)
}
-- EditorConfig support
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 has_value(g.doom_disabled_plugins, 'editorconfig-vim'))
disable = (disabled_files and true or disabled_editorconfig)
}
-- Tree-Sitter
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 has_value(g.doom_disabled_plugins, 'tree-sitter'))
disable = (disabled_files and true or disabled_treesitter)
}
-- Comments
-- can be disabled to use your own comments plugin
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 has_value(g.doom_disabled_plugins, 'kommentary'))
disable = (disabled_files and true or disabled_kommentary)
}
-----[[-------------]]-----
--- Web Related ---
-----]]-------------[[-----
disabled_web = has_value(g.doom_disabled_plugins_group, 'web')
-- Fastest colorizer without external dependencies!
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 has_value(g.doom_disabled_plugins, 'nvim-colorizer'))
disable = (disabled_web and true or disabled_colorizer)
}
-- HTPP Client support
-- Depends on bayne/dot-http to work!
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 has_value(g.doom_disabled_plugins, 'vim-dot-http'))
disable = (disabled_web and true or disabled_restclient)
}
-- Emmet plugin
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 has_value(g.doom_disabled_plugins, 'emmet-vim'))
disable = (disabled_web and true or disabled_emmet)
}
end)

Loading…
Cancel
Save