Browse Source

feat: added a ton of new features and cool plugins (#88)

Co-authored-by: Alejandro <bloodbathalchemist@protonmail.com>
my-config
molleweide 3 years ago
committed by GitHub
parent
commit
034d2f06da
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 9
      docs/contributing.md
  3. 7
      doom_config.lua
  4. 15
      doomrc.lua
  5. 1
      init.lua
  6. 11
      lua/doom/README.md
  7. 19
      lua/doom/core/config/doomrc.lua
  8. 8
      lua/doom/core/config/init.lua
  9. 5
      lua/doom/core/settings/init.lua
  10. 2
      lua/doom/core/system/init.lua
  11. 104
      lua/doom/extras/keybindings/init.lua
  12. 31
      lua/doom/modules/config/doom-fire.lua
  13. 7
      lua/doom/modules/config/doom-todo.lua
  14. 3
      lua/doom/modules/config/doom-treesitter.lua
  15. 7
      lua/doom/modules/config/doom-trouble.lua
  16. 12
      lua/doom/modules/config/doom-whichkey.lua
  17. 35
      lua/doom/modules/init.lua

1
.gitignore

@ -3,6 +3,7 @@ plugin/
sessions/ sessions/
undodir/ undodir/
time_cost.txt time_cost.txt
tags
# Backup files # Backup files
.doom_releases .doom_releases
.doom_backup_hash .doom_backup_hash

9
docs/contributing.md

@ -23,6 +23,15 @@ and which code style you should use :heart:
so that it works correctly on your environment, you can do it freely since I so that it works correctly on your environment, you can do it freely since I
currently do not have that system to do tests. currently do not have that system to do tests.
## Jumping between two branches
If you have a personal branch and then a second branch only made for creating PRs
you will most likely have to remove the `plugin/packer_compiled.lua` file every
time you checkout the `pull_request_branch`. This is because the pr branch most likely
will have less settings and plugins than you personal branch and therefore it will
not work as expected otherwise. Eg. you will see 'Dashboard' text on vim load instead of
'Doom'.
## Reporting issues ## Reporting issues
### Acquire a backtrace from errors ### Acquire a backtrace from errors

7
doom_config.lua

@ -143,6 +143,13 @@ local doom = {
-- @default = true -- @default = true
relative_num = true, relative_num = true,
-- Enable winwidth
-- false : Manually set win width
-- true : Active window auto sets width
-- @default = false, @default win_width_nr = 85
win_width = false,
win_width_nr = 85,
-- Enable Highlight on yank -- Enable Highlight on yank
-- false : disables highligh on yank -- false : disables highligh on yank
-- true : enables highlight on yank -- true : enables highlight on yank

15
doomrc.lua

@ -20,24 +20,26 @@ local doom = {
-- "zen", -- Distraction free environment -- "zen", -- Distraction free environment
"which-key", -- Keybindings popup menu like Emacs' guide-key "which-key", -- Keybindings popup menu like Emacs' guide-key
-- "indentlines", -- Show indent lines -- "indentlines", -- Show indent lines
-- "show_registers", -- popup that shows register contents
-- "indentlines", -- Show indent lines
}, },
doom = { doom = {
-- "neorg", -- Life Organization Tool -- "neorg", -- Life Organization Tool
-- "runner", -- Open a REPL for the current language or run the current file -- "runner", -- Open a REPL for the current language or run the current file
-- "compiler", -- Compile (and run) your code with just pressing three keys! -- "compiler", -- Compile (and run) your code with just pressing three keys!
}, },
editor = { editor = {
"auto-session", -- A small automated session manager for Neovim "auto-session", -- A small automated session manager for Neovim
-- "terminal", -- Terminal for Neovim (NOTE: needed for runner and compiler) "terminal", -- Terminal for Neovim (NOTE: needed for runner and compiler)
"explorer", -- Tree explorer "explorer", -- Tree explorer
-- "ranger", -- Ranger File Browser, requires ranger file browser
"symbols", -- LSP symbols and tags "symbols", -- LSP symbols and tags
-- "minimap", -- Code minimap, requires github.com/wfxr/code-minimap -- "minimap", -- Code minimap, requires github.com/wfxr/code-minimap
"gitsigns", -- Git signs "gitsigns", -- Git signs
"telescope", -- Highly extendable fuzzy finder over lists "telescope", -- Highly extendable fuzzy finder over lists
-- "restclient", -- A fast Neovim http client
"formatter", -- File formatting "formatter", -- File formatting
"autopairs", -- Autopairs "autopairs", -- Autopairs
-- "editorconfig", -- EditorConfig support for Neovim -- "editorconfig", -- EditorConfig support for Neovim
"kommentary", -- Comments plugin "kommentary", -- Comments plugin
"lsp", -- Language Server Protocols "lsp", -- Language Server Protocols
"dap", -- Debug Adapter Protocol "dap", -- Debug Adapter Protocol
@ -74,6 +76,11 @@ local doom = {
-- "colorizer", -- Fastest colorizer for Neovim -- "colorizer", -- Fastest colorizer for Neovim
"range-highlight", -- hightlights ranges you have entered in commandline "range-highlight", -- hightlights ranges you have entered in commandline
}, },
web = {
-- "restclient", -- A fast Neovim http client
-- "firenvim", -- requires firenvim web extension; change fontsize by increasing guifontsize in doomrc
-- "colorizer", -- Fastest colorizer for Neovim
}
} }
return doom return doom

1
init.lua

@ -19,7 +19,6 @@ vim.cmd([[
-- Temporarily disable shada file to improve performance -- Temporarily disable shada file to improve performance
vim.opt.shadafile = "NONE" vim.opt.shadafile = "NONE"
-- Disable some unused built-in Neovim plugins -- Disable some unused built-in Neovim plugins
vim.g.loaded_man = false
vim.g.loaded_gzip = false vim.g.loaded_gzip = false
vim.g.loaded_netrwPlugin = false vim.g.loaded_netrwPlugin = false
vim.g.loaded_tarPlugin = false vim.g.loaded_tarPlugin = false

11
lua/doom/README.md

@ -11,3 +11,14 @@ divided into three different sub-modules.
and their configurations. and their configurations.
- [utils](./utils/README.md) - The Doom utilities, herein lies the Doom utility - [utils](./utils/README.md) - The Doom utilities, herein lies the Doom utility
functions. functions.
## Note: dev w/ctags
1. ctags for jumping to func defs
https://github.com/universal-ctags/ctags
2. In doom-nvim root run `ctags --recurse`
3. Put cursos on top of require file name
4. Press `<leader>nt`
5. This will jump to the definition of whatever is under cursor.

19
lua/doom/core/config/doomrc.lua

@ -17,13 +17,14 @@ log.debug("Loading Doom doomrc module ...")
local function default_doomrc_values() local function default_doomrc_values()
return { return {
ui = { ui = {
"dashboard", -- Start screen "dashboard", -- Start screen
-- 'doom-themes', -- Additional doom emacs' colorschemes -- 'doom-themes', -- Additional doom emacs' colorschemes
"statusline", -- Statusline "statusline", -- Statusline
"tabline", -- Tabline, shows your buffers list at top "tabline", -- Tabline, shows your buffers list at top
-- 'zen', -- Distraction free environment -- 'zen', -- Distraction free environment
"which-key", -- Keybindings popup menu like Emacs' guide-key "which-key", -- Keybindings popup menu like Emacs' guide-key
-- 'indentlines', -- Show indent lines -- "show_registers", -- popup that shows register contents
-- 'indentlines', -- Show indent lines
}, },
doom = { doom = {
-- 'neorg', -- Life Organization Tool -- 'neorg', -- Life Organization Tool
@ -34,11 +35,11 @@ local function default_doomrc_values()
"auto-session", -- A small automated session manager for Neovim "auto-session", -- A small automated session manager for Neovim
-- 'terminal', -- Terminal for Neovim (NOTE: needed for runner and compiler) -- 'terminal', -- Terminal for Neovim (NOTE: needed for runner and compiler)
"explorer", -- Tree explorer "explorer", -- Tree explorer
-- "ranger", -- Ranger File Browser, requires ranger file browser
"symbols", -- LSP symbols and tags "symbols", -- LSP symbols and tags
-- 'minimap', -- Code minimap, requires github.com/wfxr/code-minimap -- 'minimap', -- Code minimap, requires github.com/wfxr/code-minimap
"gitsigns", -- Git signs "gitsigns", -- Git signs
"telescope", -- Highly extendable fuzzy finder over lists "telescope", -- Highly extendable fuzzy finder over lists
-- 'restclient', -- A fast Neovim http client
"formatter", -- File formatting "formatter", -- File formatting
"autopairs", -- Autopairs "autopairs", -- Autopairs
-- 'editorconfig', -- EditorConfig support for Neovim -- 'editorconfig', -- EditorConfig support for Neovim
@ -74,9 +75,13 @@ local function default_doomrc_values()
-- 'suda', -- Write and read files without sudo permissions -- 'suda', -- Write and read files without sudo permissions
-- 'lazygit', -- LazyGit integration for Neovim, requires LazyGit -- 'lazygit', -- LazyGit integration for Neovim, requires LazyGit
-- 'neogit', -- Magit for Neovim -- 'neogit', -- Magit for Neovim
-- 'colorizer', -- Fastets colorizer for Neovim
"range-highlight", -- hightlights ranges you have entered in commandline "range-highlight", -- hightlights ranges you have entered in commandline
}, },
web = {
-- 'restclient', -- A fast Neovim http client
-- "firenvim", -- requires firenvim extension to be installed in webbrowser
-- 'colorizer', -- Fastets colorizer for Neovim
}
} }
end end

8
lua/doom/core/config/init.lua

@ -164,6 +164,14 @@ local function default_doom_config_values()
-- @default = true -- @default = true
relative_num = true, relative_num = true,
-- Enable winwidth
-- false : Manually set win width
-- true : Active window auto sets width
-- @default = false, @default win_width_nr = 85
win_width = false,
win_width_nr = 85,
-- Enable Highlight on yank -- Enable Highlight on yank
-- false : disables highligh on yank -- false : disables highligh on yank
-- true : enables highlight on yank -- true : enables highlight on yank

5
lua/doom/core/settings/init.lua

@ -107,6 +107,11 @@ M.load_default_options = function()
vim.opt.number = true vim.opt.number = true
end end
-- Enable winwidth
if config.doom.win_width then
vim.opt.winwidth = config.doom.win_width_nr
end
-- Checks to see if undo_dir does not exist. If it doesn't, it will create a undo folder -- Checks to see if undo_dir does not exist. If it doesn't, it will create a undo folder
local undo_dir = vim.fn.stdpath("config") .. config.doom.undo_dir local undo_dir = vim.fn.stdpath("config") .. config.doom.undo_dir
if config.doom.backup and vim.fn.empty(vim.fn.glob(undo_dir)) > 0 then if config.doom.backup and vim.fn.empty(vim.fn.glob(undo_dir)) > 0 then

2
lua/doom/core/system/init.lua

@ -36,7 +36,7 @@ M.sep = get_separator()
-- in case that doom_configs_root directory does not exists. -- in case that doom_configs_root directory does not exists.
M.doom_root = string.format("%s%snvim", M.config_dir, M.sep) M.doom_root = string.format("%s%snvim", M.config_dir, M.sep)
-- The doom-nvim configurations root directory -- The doom-nvim configurations root directory
M.doom_configs_root = string.format("%s%sdoom-nvim", M.config_dir, M.sep) M.doom_configs_root = string.format("%s%snvim", M.config_dir, M.sep)
-- The doom-nvim logs file path -- The doom-nvim logs file path
M.doom_logs = vim.fn.stdpath("data") .. string.format("%sdoom.log", M.sep) M.doom_logs = vim.fn.stdpath("data") .. string.format("%sdoom.log", M.sep)
-- The doom-nvim bug report file path -- The doom-nvim bug report file path

104
lua/doom/extras/keybindings/init.lua

@ -320,6 +320,24 @@ utils.map("n", "<C-l>", "<C-w>l", opts, "Movement", "right_window", "Goto right
---]]-----------------[[--- ---]]-----------------[[---
utils.map("i", "jk", "<ESC>", opts, "Editor", "exit_insert", "Exit insert mode") utils.map("i", "jk", "<ESC>", opts, "Editor", "exit_insert", "Exit insert mode")
---[[-----------------]]---
-- Make inclusive --
---]]-----------------[[---
-- BUG: my nvim freezes from this when which key shows up
-- NOTE: IMO inclusive is better
-- utils.map("o", "T", "vT", opts, "Editor", "occurence_backw_inclusive", "Backwards occurence inclusive")
-- utils.map("o", "F", "vF", opts, "Editor", "occurence_backw_till_inclusive", "Backwards occurence till inclusive")
---[[-----------------]]---
-- Move Lines --
---]]-----------------[[---
utils.map("n", '<a-j>', ':m .+1<CR>==', opts, "Editor", "normal_move_line_down", "Normal Move line down")
utils.map("n", '<a-k>', ':m .-2<CR>==', opts, "Editor", "normal_move_line_up", "Normal Move line up")
utils.map("i", '<a-j>', '<esc>:m .+1<CR>==gi', opts, "Editor", "instert_move_line_down", "Insert Move line down")
utils.map("i", '<a-k>', '<esc>:m .-2<CR>==gi', opts, "Editor", "instert_move_line_up", "Insert Move line up")
utils.map("v", '<a-j>', ':m \'>+1<CR>gv=gv', opts, "Editor", "visual_move_line_down", "Visual Move line down")
utils.map("v", '<a-k>', ':m \'<-2<CR>gv=gv', opts, "Editor", "visual_move_line_up", "Visual Move line up")
---[[-----------------]]--- ---[[-----------------]]---
-- Select Movement -- -- Select Movement --
---]]-----------------[[--- ---]]-----------------[[---
@ -861,6 +879,15 @@ utils.map(
"open_minimap_alt", "open_minimap_alt",
"Toggle code minimap" "Toggle code minimap"
) )
utils.map(
"n",
"<leader>or",
"<cmd>Ranger<CR>",
opts,
"Editor",
"open_ranger_browser",
"Toggle Ranger File Browser"
)
utils.map( utils.map(
"n", "n",
"<leader>os", "<leader>os",
@ -1033,3 +1060,80 @@ utils.map(
"diagnostic_list", "diagnostic_list",
"Diagnostics into location list" "Diagnostics into location list"
) )
-- jumps
utils.map(
'n',
'<leader>ja',
'<C-^>',
opts,
"Jumps",
"jump_alternate_file",
"Alternate file"
)
utils.map(
'n',
'<leader>jj',
'<C-o>',
opts,
"Jumps",
"jump_older",
"Jump to older pos"
)
utils.map(
'n',
'<leader>jk',
'<C-i>',
opts,
"Jumps",
"jump_newer",
"Jump to newer pos"
)
utils.map(
'n',
'<leader>jp',
':pop<CR>',
opts,
"Jumps",
"jump_pop_tag",
"Pop from tag stack"
)
utils.map(
'n',
'<leader>jt',
':tag<CR>',
opts,
"Jumps",
"jump_folow_tag",
"Follow tag / add to stack"
)
-- save
utils.map(
'n',
'<leader>v',
'<cmd>w<cr>',
opts,
"Save",
"save_left",
"Save v"
)
utils.map(
'n',
'<leader>m',
'<cmd>w<cr>',
opts,
"Save",
"save_right",
"Save m"
)
-- man pages
utils.map(
'n',
'<leader>h',
':Man ',
{silent = false},
"Man page",
"man_page",
"Man page"
)

31
lua/doom/modules/config/doom-fire.lua

@ -0,0 +1,31 @@
return function()
-- TODO: this option should make firenvim NOT trigger on enter textarea
-- so that user can trigger nvim with keybinding instead.
-- however, something is not working here so...
-- NOTE: see this issue for help https://github.com/glacambre/firenvim/issues/991
-- required global config object
-- vim.cmd([[
-- let g:firenvim_config = {
-- \ 'globalSettings': {
-- \ 'alt': 'all',
-- \ },
-- \ 'localSettings': {
-- \ '.*': {
-- \ 'cmdline': 'neovim',
-- \ 'content': 'text',
-- \ 'priority': 0,
-- \ 'selector': 'textarea',
-- \ 'takeover': 'always',
-- \ },
-- \ }
-- \ }
-- ]])
-- -- disable nvim from triggering on entering textarea
-- vim.cmd([[
-- let fc = g:firenvim_config['localSettings']
-- let fc['.*'] = { 'takeover': 'never' }
-- ]])
end

7
lua/doom/modules/config/doom-todo.lua

@ -0,0 +1,7 @@
return function()
require("todo-comments").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
end

3
lua/doom/modules/config/doom-treesitter.lua

@ -39,6 +39,9 @@ return function()
table.insert(doomrc.langs, "norg") table.insert(doomrc.langs, "norg")
end end
-- macos uses wrong c version
require('nvim-treesitter.install').compilers = { 'gcc' }
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
ensure_installed = get_ts_parsers(doomrc.langs), ensure_installed = get_ts_parsers(doomrc.langs),
highlight = { enable = true }, highlight = { enable = true },

7
lua/doom/modules/config/doom-trouble.lua

@ -0,0 +1,7 @@
return function()
require("trouble").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
end

12
lua/doom/modules/config/doom-whichkey.lua

@ -72,6 +72,9 @@ return function()
[","] = { "Switch buffer" }, [","] = { "Switch buffer" },
["/"] = { "Search a word" }, ["/"] = { "Search a word" },
[":"] = { "Command history" }, [":"] = { "Command history" },
["h"] = { "Manpage" },
["m"] = { "Save" },
["v"] = { "Save" },
["b"] = { ["b"] = {
name = "+buffers", name = "+buffers",
["c"] = { "Close current buffer" }, ["c"] = { "Close current buffer" },
@ -189,10 +192,19 @@ return function()
["b"] = { "Debugging UI " }, ["b"] = { "Debugging UI " },
["d"] = { "Start screen" }, ["d"] = { "Start screen" },
["e"] = { "Tree Explorer" }, ["e"] = { "Tree Explorer" },
["r"] = { "Ranger File Browser" },
["m"] = { "Minimap" }, ["m"] = { "Minimap" },
["s"] = { "Symbols" }, ["s"] = { "Symbols" },
["t"] = { "Terminal" }, ["t"] = { "Terminal" },
}, },
['j'] = {
name = '+jumps',
['a'] = { 'Alternate file', },
['j'] = { 'jump back', },
['k'] = { 'jump forward', },
['p'] = { 'pop tag stack', },
['t'] = { 'jump to tag', },
},
} }
wk.register(mappings, { prefix = "<leader>" }) wk.register(mappings, { prefix = "<leader>" })

35
lua/doom/modules/init.lua

@ -126,6 +126,14 @@ packer.startup(function(use)
}, },
}) })
-- Ranger File Browser
local disabled_ranger = functions.is_plugin_disabled("ranger")
use({
"francoiscabrol/ranger.vim",
requires = "rbgrouleff/bclose.vim",
disable = disabled_ranger,
})
-- Statusline -- Statusline
-- can be disabled to use your own statusline -- can be disabled to use your own statusline
local disabled_statusline = functions.is_plugin_disabled("statusline") local disabled_statusline = functions.is_plugin_disabled("statusline")
@ -195,6 +203,13 @@ packer.startup(function(use)
disable = disabled_whichkey, disable = disabled_whichkey,
}) })
-- popup that shows contents of each register
local disabled_show_registers = functions.is_plugin_disabled("show_registers")
use({
"tversteeg/registers.nvim",
disable = disabled_show_registers
})
-- Distraction free environment -- Distraction free environment
local disabled_zen = functions.is_plugin_disabled("zen") local disabled_zen = functions.is_plugin_disabled("zen")
use({ use({
@ -450,6 +465,26 @@ packer.startup(function(use)
event = "BufRead", event = "BufRead",
}) })
local disabled_firenvim = functions.is_plugin_disabled("firenvim")
use({
'glacambre/firenvim',
disable = disabled_firenvim,
run = function() vim.fn['firenvim#install'](0) end,
config = require('doom.modules.config.doom-fire'),
})
use({
"folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim",
config = require('doom.modules.config.doom-todo'),
})
use({
"folke/trouble.nvim",
requires = "kyazdani42/nvim-web-devicons",
config = require('doom.modules.config.doom-trouble'),
})
use({ "jez/vim-superman" })
-----[[----------------]]----- -----[[----------------]]-----
--- Custom Plugins --- --- Custom Plugins ---
-----]]----------------[[----- -----]]----------------[[-----

Loading…
Cancel
Save