diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index f84e7ed..0000000
--- a/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-spell/
diff --git a/README.md b/README.md
deleted file mode 100644
index f6570bf..0000000
--- a/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
Welcome To My Neovim Config
-
-
-## Versioning
-The master branch contains my current config, major revisions are tagged: v#.#
-
-## Use Case
-My config is built around what I work on; this mainly includes: c, lua, java, and shell scripting. I also try to keep my config relatively portable which is why I to not use any nerd fonts
-
-## Plugins
-For plugin management I use my own [fork](https://git.squi.bid/dep/) of [Dep](https://github.com/chiyadev/dep) To find the current list of plugins go to the [plugin.lua](https://git.squi.bid/nvim/tree/lua/conf/plugins.lua) file.
diff --git a/after/ftplugin/c.lua b/after/ftplugin/c.lua
new file mode 100644
index 0000000..6d4efca
--- /dev/null
+++ b/after/ftplugin/c.lua
@@ -0,0 +1,6 @@
+local misc = require('core.misc')
+local map_local = misc.map_local
+
+-- sort #includes <> (very jank)
+-- TODO: rewrite in a semi-sane way
+map_local("n", "cri", "mz/^#include.*<.*>$ggVGN:sort`zdelm z:nohlsearch:echo")
diff --git a/after/ftplugin/gitcommit.lua b/after/ftplugin/gitcommit.lua
deleted file mode 100644
index dece15e..0000000
--- a/after/ftplugin/gitcommit.lua
+++ /dev/null
@@ -1 +0,0 @@
-vim.cmd('startinsert | 1')
diff --git a/after/ftplugin/gitrebase.lua b/after/ftplugin/gitrebase.lua
deleted file mode 120000
index 9619e9a..0000000
--- a/after/ftplugin/gitrebase.lua
+++ /dev/null
@@ -1 +0,0 @@
-gitcommit.lua
\ No newline at end of file
diff --git a/after/ftplugin/help.lua b/after/ftplugin/help.lua
deleted file mode 100644
index fe6caae..0000000
--- a/after/ftplugin/help.lua
+++ /dev/null
@@ -1 +0,0 @@
-vim.treesitter.start()
diff --git a/after/ftplugin/java.lua b/after/ftplugin/java.lua
deleted file mode 100644
index 2c3db93..0000000
--- a/after/ftplugin/java.lua
+++ /dev/null
@@ -1,255 +0,0 @@
--- NOTE: Make sure you're $JAVA_HOME is correct (prob should be 17 or higher)
-local java_cmds = vim.api.nvim_create_augroup('java_cmds', {clear = true})
-local cache_vars = {}
-
-local root_files = {
- '.git',
- 'mvnw',
- 'gradlew',
- 'pom.xml',
- 'build.gradle',
-}
-
-local features = {
- -- change this to `true` to enable codelens
- codelens = true,
-
- -- change this to `true` if you have `nvim-dap`,
- -- `java-test` and `java-debug-adapter` installed
- debugger = true,
-}
-
-local function get_jdtls_paths()
- if cache_vars.paths then
- return cache_vars.paths
- end
-
- local path = {}
- path.data_dir = vim.fn.stdpath('cache') .. '/nvim-jdtls'
- local jdtls_install = require('mason-registry').get_package('jdtls'):get_install_path()
- path.java_agent = jdtls_install .. '/lombok.jar'
- path.launcher_jar = vim.fn.glob(jdtls_install .. '/plugins/org.eclipse.equinox.launcher_*.jar')
- path.platform_config = jdtls_install .. '/config_linux'
- path.bundles = {}
-
- -- Include java-test bundle if present
- local java_test_path = require('mason-registry')
- .get_package('java-test')
- :get_install_path()
-
- local java_test_bundle = vim.split(
- vim.fn.glob(java_test_path .. '/extension/server/*.jar'),
- '\n'
- )
-
- if java_test_bundle[1] ~= '' then
- vim.list_extend(path.bundles, java_test_bundle)
- end
-
- -- Include java-debug-adapter bundle if present
- local java_debug_path = require('mason-registry')
- .get_package('java-debug-adapter')
- :get_install_path()
-
- local java_debug_bundle = vim.split(
- vim.fn.glob(java_debug_path .. '/extension/server/com.microsoft.java.debug.plugin-*.jar'),
- '\n'
- )
-
- if java_debug_bundle[1] ~= '' then
- vim.list_extend(path.bundles, java_debug_bundle)
- end
-
- -- Useful if you're starting jdtls with a Java version that's
- -- different from the one the project uses.
- path.runtimes = {
- -- Note: the field `name` must be a valid `ExecutionEnvironment`,
- -- you can find the list here:
- -- https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request
- --
- -- This example assume you are using sdkman: https://sdkman.io
- -- {
- -- name = 'JavaSE-17',
- -- path = vim.fn.expand('~/.sdkman/candidates/java/17.0.6-tem'),
- -- },
- -- {
- -- name = 'JavaSE-18',
- -- path = vim.fn.expand('~/.sdkman/candidates/java/18.0.2-amzn'),
- -- },
- }
-
- cache_vars.paths = path
- return path
-end
-
-local function enable_codelens(bufnr)
- pcall(vim.lsp.codelens.refresh)
-
- vim.api.nvim_create_autocmd('BufWritePost', {
- buffer = bufnr,
- group = java_cmds,
- desc = 'refresh codelens',
- callback = function()
- pcall(vim.lsp.codelens.refresh)
- end,
- })
-end
-
-local function enable_debugger(bufnr)
- require('jdtls').setup_dap({hotcodereplace = 'auto'})
- require('jdtls.dap').setup_dap_main_class_configs()
-
- local opts = {buffer = bufnr}
- vim.keymap.set('n', 'df', "lua require('jdtls').test_class()", opts)
- vim.keymap.set('n', 'dn', "lua require('jdtls').test_nearest_method()", opts)
-end
-
-local function jdtls_on_attach(client, bufnr)
- if features.debugger then
- enable_debugger(bufnr)
- end
-
- if features.codelens then
- enable_codelens(bufnr)
- end
-
- -- The following mappings are based on the suggested usage of nvim-jdtls
- -- https://github.com/mfussenegger/nvim-jdtls#usage
- local opts = {buffer = bufnr}
- vim.keymap.set('n', 'cri', "lua require('jdtls').organize_imports()", opts)
- vim.keymap.set('n', 'crv', "lua require('jdtls').extract_variable()", opts)
- vim.keymap.set('x', 'crv', "lua require('jdtls').extract_variable(true)", opts)
- vim.keymap.set('n', 'crc', "lua require('jdtls').extract_constant()", opts)
- vim.keymap.set('x', 'crc', "lua require('jdtls').extract_constant(true)", opts)
- vim.keymap.set('x', 'crm', "lua require('jdtls').extract_method(true)", opts)
-end
-
-local function jdtls_setup(event)
- local jdtls = require('jdtls')
-
- local path = get_jdtls_paths()
- local data_dir = path.data_dir .. '/' .. vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t')
-
- if cache_vars.capabilities == nil then
- jdtls.extendedClientCapabilities.resolveAdditionalTextEditsSupport = true
-
- local ok_cmp, cmp_lsp = pcall(require, 'cmp_nvim_lsp')
- cache_vars.capabilities = vim.tbl_deep_extend(
- 'force',
- vim.lsp.protocol.make_client_capabilities(),
- ok_cmp and cmp_lsp.default_capabilities() or {}
- )
- end
-
- -- The command that starts the language server
- -- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line
- local cmd = {
- 'java',
-
- '-Declipse.application=org.eclipse.jdt.ls.core.id1',
- '-Dosgi.bundles.defaultStartLevel=4',
- '-Declipse.product=org.eclipse.jdt.ls.core.product',
- '-Dlog.protocol=true',
- '-Dlog.level=ALL',
- '-javaagent:' .. path.java_agent,
- '-Xms1G',
- '--add-modules=ALL-SYSTEM',
- '--add-opens',
- 'java.base/java.util=ALL-UNNAMED',
- '--add-opens',
- 'java.base/java.lang=ALL-UNNAMED',
- '-jar', path.launcher_jar,
- '-configuration', path.platform_config,
- '-data', data_dir,
- }
-
- local lsp_settings = {
- java = {
- -- jdt = {
- -- ls = {
- -- vmargs = "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m"
- -- }
- -- },
- eclipse = {
- downloadSources = true,
- },
- configuration = {
- updateBuildConfiguration = 'interactive',
- runtimes = path.runtimes,
- },
- maven = {
- downloadSources = true,
- },
- implementationsCodeLens = {
- enabled = true,
- },
- referencesCodeLens = {
- enabled = true,
- },
- -- inlayHints = {
- -- parameterNames = {
- -- enabled = 'all' -- literals, all, none
- -- }
- -- },
- format = {
- enabled = true,
- -- settings = {
- -- profile = 'asdf'
- -- },
- }
- },
- signatureHelp = {
- enabled = true,
- },
- completion = {
- favoriteStaticMembers = {
- 'org.hamcrest.MatcherAssert.assertThat',
- 'org.hamcrest.Matchers.*',
- 'org.hamcrest.CoreMatchers.*',
- 'org.junit.jupiter.api.Assertions.*',
- 'java.util.Objects.requireNonNull',
- 'java.util.Objects.requireNonNullElse',
- 'org.mockito.Mockito.*',
- },
- },
- contentProvider = {
- preferred = 'fernflower',
- },
- extendedClientCapabilities = jdtls.extendedClientCapabilities,
- sources = {
- organizeImports = {
- starThreshold = 9999,
- staticStarThreshold = 9999,
- }
- },
- codeGeneration = {
- toString = {
- template = '${object.className}{${member.name()}=${member.value}, ${otherMembers}}',
- },
- useBlocks = true,
- },
- }
-
- -- This starts a new client & server,
- -- or attaches to an existing client & server depending on the `root_dir`.
- jdtls.start_or_attach({
- cmd = cmd,
- settings = lsp_settings,
- on_attach = jdtls_on_attach,
- capabilities = cache_vars.capabilities,
- root_dir = jdtls.setup.find_root(root_files),
- flags = {
- allow_incremental_sync = true,
- },
- init_options = {
- bundles = path.bundles,
- },
- })
-end
-
-vim.api.nvim_create_autocmd('FileType', {
- group = java_cmds,
- pattern = {'java'},
- desc = 'Setup jdtls',
- callback = jdtls_setup,
-})
diff --git a/after/ftplugin/netrw.lua b/after/ftplugin/netrw.lua
new file mode 100644
index 0000000..98d7dd7
--- /dev/null
+++ b/after/ftplugin/netrw.lua
@@ -0,0 +1,20 @@
+local misc = require("core.misc")
+local map_local = misc.map_local
+
+map_local("n", "h", "-", { noremap = false, remap = true }) -- Go up a directory
+map_local("n", "l", "", { noremap = false, remap = true }) -- Go down a directory / open a file
+map_local("n", ".", "gh", { noremap = false, remap = true }) -- Toggle hidden files
+map_local("n", "P", "z", { noremap = false, remap = true }) -- Close preview window
+
+-- Close netrw only if it isn't the last window
+map_local("n", "", function()
+ if #vim.api.nvim_tabpage_list_wins(0) > 1 then
+ vim.api.nvim_win_close(0, false)
+ end
+end)
+
+-- change neovim root
+map_local("n", "rt", function()
+ vim.api.nvim_set_current_dir(vim.b.netrw_curdir)
+ vim.notify("root dir updated: "..vim.b.netrw_curdir, vim.log.levels.LOW, { title = misc.appid })
+end)
diff --git a/after/ftplugin/norg.lua b/after/ftplugin/norg.lua
index 851228e..fc69be9 100644
--- a/after/ftplugin/norg.lua
+++ b/after/ftplugin/norg.lua
@@ -1,3 +1,28 @@
+local misc = require('core.misc')
+
+-- make sure norg parsers are installed before opening a norg file, currently
+-- there are two parsers: norg, and norg_meta
+local found = {}
+found[0] = 0 -- used to store the number of elements in the table
+
+-- check for the parsers
+misc.loopf(vim.fn.stdpath("data").."/site/pack/deps/opt/nvim-treesitter/parser",
+ function(file)
+ if string.find(file, "norg") then
+ found[file] = true
+ found[0] = found[0] + 1
+ end
+end, "so")
+
+-- if the parsers don't exist download them
+if found[0] < 2 and
+ (not found["norg.so"] or not found["norg_meta.so"]) then
+ vim.cmd("Neorg sync-parsers")
+end
+
+-- set colorcolumn in norg buffers
+vim.opt_local.colorcolumn = { 80 }
+
+-- make text wrap at the colorcolumn automatically
vim.api.nvim_set_option_value("textwidth",
tonumber(vim.api.nvim_get_option_value("colorcolumn", {})), { buf = 0 })
-vim.api.nvim_win_set_option(0, 'colorcolumn', '0')
diff --git a/after/plugin/actionpreview.lua b/after/plugin/actionpreview.lua
deleted file mode 100644
index 750e06b..0000000
--- a/after/plugin/actionpreview.lua
+++ /dev/null
@@ -1,16 +0,0 @@
-local status_ok, actions = pcall(require, "actions-preview")
-if not status_ok then
- return
-end
-
-actions.setup {
- backend = { "telescope" },
- telescope = require("telescope.themes").get_dropdown {
- borderchars = {
- prompt = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' };
- results = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' };
- preview = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' };
- },
- layout_strategy = 'cursor',
- }
-}
diff --git a/after/plugin/auto-indent.lua b/after/plugin/auto-indent.lua
deleted file mode 100644
index fafb0bc..0000000
--- a/after/plugin/auto-indent.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-local status_ok, indent = pcall(require, "auto-indent")
-if not status_ok then
- return
-end
-
-indent.setup {
- indentexpr = function(lnum)
- return require("nvim-treesitter.indent").get_indent(lnum)
- end
-}
diff --git a/after/plugin/autopairs.lua b/after/plugin/autopairs.lua
deleted file mode 100644
index 64c379d..0000000
--- a/after/plugin/autopairs.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-local status_ok, autopairs = pcall(require, "ultimate-autopair")
-if not status_ok then
- return
-end
-
-autopairs.setup {
- ignored_next_char = string.gsub("!@#$%^&*()_+", "%s+", "")
-}
diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua
deleted file mode 100644
index 4c4309d..0000000
--- a/after/plugin/cmp.lua
+++ /dev/null
@@ -1,143 +0,0 @@
-local status_ok, cmp = pcall(require, "cmp")
-if not status_ok then
- return
-end
-
-local function has_words_before()
- unpack = unpack or table.unpack
- local line, col = unpack(a.nvim_win_get_cursor(0))
- return col ~= 0 and a.nvim_buf_get_lines(0, line - 1, line, true)
- [1]:sub(col, col):match("%s") == nil
-end
-
-local luasnip = require('luasnip')
-local neogen = require('neogen')
-require("luasnip.loaders.from_vscode").lazy_load()
-
-cmp.setup {
- sources = cmp.config.sources({
- { name = 'nvim_lsp', priority = 999 },
- { name = 'luasnip_choice', priority = 750 },
- { name = 'buffer', max_item_count = 3 },
- { name = 'async_path', max_item_count = 5 },
- { name = 'nvim_lua' },
- { name = 'neorg' },
- { name = 'calc' },
- { name = 'cmdline' },
- { name = 'nvim_lsp_signature_help' }
- }),
-
- window = {
- completion = {
- scrollbar = false,
- border = 'solid',
- winhighlight = "Normal:WinBarNC,FloatBorder:WinBarNC,Search:WinBarNC",
- },
- documentation = {
- border = 'solid',
- winhighlight = "Normal:WinBarNC,FloatBorder:WinBarNC,Search:WinBarNC",
- }
- },
-
- view = {
- entries = { name = 'custom', selection_order = 'near_cursor' },
- },
-
- experimental = {
- ghost_text = true
- },
-
- formatting = {
- fields = {'menu', 'abbr', 'kind'},
- format = function(entry, item)
- local menu_icon = {
- nvim_lsp = 'λ',
- nvim_lua = 'v',
- calc = '+',
- luasnip = '%',
- buffer = '@',
- path = '#',
- }
-
- item.menu = menu_icon[entry.source.name]
- return item
- end,
- },
-
- snippet = {
- expand = function(args)
- luasnip.lsp_expand(args.body)
- end,
- },
-
- -- mappings -----------------------------------------------------------------
- mapping = cmp.mapping.preset.insert({
- [""] = cmp.mapping(function(fallback)
- if #cmp.get_entries() == 1 then
- cmp.confirm({ select = true })
- elseif cmp.visible() then
- cmp.select_next_item()
- elseif luasnip.expand_or_locally_jumpable() then
- luasnip.expand_or_jump()
- elseif has_words_before() then
- cmp.complete()
- if #cmp.get_entries() == 1 then
- cmp.confirm({ select = true })
- end
- elseif neogen.jumpable() then
- neogen.jump_next()
- else
- fallback()
- end
- end, { "i", "s" }),
- [""] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.select_prev_item()
- elseif luasnip.jumpable(-1) then
- luasnip.jump(-1)
- elseif neogen.jumpable(true) then
- neogen.jump_prev()
- else
- fallback()
- end
- end, { "i", "s" }),
- [''] = cmp.mapping {
- i = function(fallback)
- if cmp.visible() and cmp.get_active_entry() then
- cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false })
- else
- fallback()
- end
- end,
- s = cmp.mapping.confirm({ select = true }),
- c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace,
- select = true }),
- },
- [""] = cmp.mapping.scroll_docs(-4),
- [""] = cmp.mapping.scroll_docs(4),
- [''] = cmp.mapping.close(),
- [""] = cmp.mapping.abort(),
- }),
-
- sorting = {
- comparators = {
- cmp.config.compare.offset,
- cmp.config.compare.exact,
- cmp.config.compare.score,
- require("cmp-under-comparator").under,
- cmp.config.compare.kind,
- cmp.config.compare.sort_text,
- cmp.config.compare.length,
- cmp.config.compare.order,
- }
- },
- enabled = function()
- local context = require 'cmp.config.context'
- if a.nvim_get_mode().mode == 'c' then
- return true
- else
- return not context.in_treesitter_capture("comment")
- and not context.in_syntax_group("Comment")
- end
- end
-}
diff --git a/after/plugin/colorizer.lua b/after/plugin/colorizer.lua
deleted file mode 100644
index 830e1b9..0000000
--- a/after/plugin/colorizer.lua
+++ /dev/null
@@ -1,13 +0,0 @@
-local status_ok, colorizer = pcall(require, "colorizer")
-if not status_ok then
- return
-end
-
-colorizer.setup {
- filetypes = { '*' },
- user_default_options = {
- names = false,
- RRGGBBAA = true,
- AARRGGBB = true,
- },
-}
diff --git a/after/plugin/colorscheme.lua b/after/plugin/colorscheme.lua
new file mode 100644
index 0000000..a8936ae
--- /dev/null
+++ b/after/plugin/colorscheme.lua
@@ -0,0 +1,3 @@
+local misc = require('core.misc')
+
+misc.colorscheme('mellow')
diff --git a/after/plugin/comment.lua b/after/plugin/comment.lua
deleted file mode 100644
index 15ec3d8..0000000
--- a/after/plugin/comment.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-local status_ok, comment = pcall(require, "Comment")
-if not status_ok then
- return
-end
-
-comment.setup {}
diff --git a/after/plugin/dressing.lua b/after/plugin/dressing.lua
deleted file mode 100644
index bc21319..0000000
--- a/after/plugin/dressing.lua
+++ /dev/null
@@ -1,16 +0,0 @@
-local status_ok, dressing = pcall(require, "dressing")
-if not status_ok then
- return
-end
-
-dressing.setup {
- input = {
- enabled = true,
- title_pos = "center",
- border = 'single',
- relative = "win"
- },
- select = {
- enabled = true,
- }
-}
diff --git a/after/plugin/fidget.lua b/after/plugin/fidget.lua
deleted file mode 100644
index ee412a7..0000000
--- a/after/plugin/fidget.lua
+++ /dev/null
@@ -1,14 +0,0 @@
-local status_ok, fidget = pcall(require, "fidget")
-if not status_ok then
- return
-end
-
-fidget.setup {
- text = {
- spinner = "line",
- done = ":)",
- },
- window = {
- zindex = 1,
- }
-}
diff --git a/after/plugin/git-yodel.lua b/after/plugin/git-yodel.lua
deleted file mode 100644
index 8c814dc..0000000
--- a/after/plugin/git-yodel.lua
+++ /dev/null
@@ -1,9 +0,0 @@
-local status_ok, yodel = pcall(require, "git-yodel")
-if not status_ok then
- return
-end
-
-yodel.setup {
- border = 'shadow',
- position = 'auto'
-}
diff --git a/after/plugin/gitsigns.lua b/after/plugin/gitsigns.lua
deleted file mode 100644
index add6d10..0000000
--- a/after/plugin/gitsigns.lua
+++ /dev/null
@@ -1,69 +0,0 @@
-local status_ok, gitsigns = pcall(require, "gitsigns")
-if not status_ok then
- return
-end
-
-gitsigns.setup {
- signs = {
- add = { text = '│' },
- change = { text = '│' },
- delete = { text = '-' },
- topdelete = { text = '‾' },
- changedelete = { text = '~' },
- untracked = { text = '┆' },
- },
- signcolumn = true,
- numhl = false,
- linehl = false,
- word_diff = false,
- watch_gitdir = {
- interval = 1000,
- follow_files = true
- },
- attach_to_untracked = true,
- current_line_blame_formatter = ', - ',
- preview_config = {
- border = 'shadow',
- },
-
- on_attach = function(bufnr)
- local gs = package.loaded.gitsigns
-
- local function map(mode, l, r, opts)
- opts = opts or {}
- opts.buffer = bufnr
- vim.keymap.set(mode, l, r, opts)
- end
-
- -- Navigation
- map('n', ']c', function()
- if vim.wo.diff then return ']c' end
- vim.schedule(function() gs.next_hunk() end)
- return ''
- end, {expr=true})
-
- map('n', '[c', function()
- if vim.wo.diff then return '[c' end
- vim.schedule(function() gs.prev_hunk() end)
- return ''
- end, {expr=true})
-
- -- Actions
- map('n', 'hs', gs.stage_hunk)
- map('n', 'hr', gs.reset_hunk)
- map('v', 'hs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
- map('v', 'hr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
- map('n', 'hS', gs.stage_buffer)
- map('n', 'hu', gs.undo_stage_hunk)
- map('n', 'hR', gs.reset_buffer)
- map('n', 'hp', gs.preview_hunk)
- map('n', 'hb', function() gs.blame_line{full=true} end)
- map('n', 'tb', gs.toggle_current_line_blame)
- map('n', 'hd', gs.diffthis)
- map('n', 'hD', function() gs.diffthis('~') end)
- map('n', 'td', gs.toggle_deleted)
-
- -- Text object
- map({'o', 'x'}, 'ih', ':Gitsigns select_hunk')
- end
-}
diff --git a/after/plugin/glance.lua b/after/plugin/glance.lua
deleted file mode 100644
index 230e04c..0000000
--- a/after/plugin/glance.lua
+++ /dev/null
@@ -1,29 +0,0 @@
-local status_ok, glance = pcall(require, "glance")
-if not status_ok then
- return
-end
-
-glance.setup {
- detached = function(winid)
- return vim.api.nvim_win_get_width(winid) < 100
- end,
-
- border = {
- enable = true,
- top_char = '',
- },
- theme = {
- enable = false,
- },
- folds = {
- fold_closed = '>',
- fold_open = 'V',
- folded = true,
- },
- indent_lines = {
- enable = false,
- },
- winbar = {
- enable = true,
- },
-}
diff --git a/after/plugin/harpoon.lua b/after/plugin/harpoon.lua
deleted file mode 100644
index 61b970a..0000000
--- a/after/plugin/harpoon.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-local status_ok, harpoon = pcall(require, "harpoon")
-if not status_ok then
- return
-end
-
-harpoon.setup {}
diff --git a/after/plugin/headlines.lua b/after/plugin/headlines.lua
deleted file mode 100644
index b7b93ee..0000000
--- a/after/plugin/headlines.lua
+++ /dev/null
@@ -1,28 +0,0 @@
-local status_ok, headlines = pcall(require, "headlines")
-if not status_ok then
- return
-end
-
-headlines.setup {
- norg = {
- headline_highlights = {
- "@neorg.headings.1.title",
- "@neorg.headings.2.title",
- "@neorg.headings.3.title",
- "@neorg.headings.4.title",
- "@neorg.headings.5.title",
- "@neorg.headings.6.title"
- },
- bullets = { "", "", "", "" },
- },
- markdown = {
- headline_highlights = {
- "@neorg.headings.1.title",
- "@neorg.headings.2.title",
- "@neorg.headings.3.title",
- "@neorg.headings.4.title",
- "@neorg.headings.5.title",
- "@neorg.headings.6.title"
- }
- },
-}
diff --git a/after/plugin/indent-blankline.lua b/after/plugin/indent-blankline.lua
deleted file mode 100644
index ae187fb..0000000
--- a/after/plugin/indent-blankline.lua
+++ /dev/null
@@ -1,15 +0,0 @@
-local status_ok, ibl = pcall(require, "ibl")
-if not status_ok then
- return
-end
-
-ibl.setup {
- indent = {
- char = '▏',
- },
- scope = {
- enabled = true,
- show_start = false,
- show_end = false
- },
-}
diff --git a/after/plugin/jabs.lua b/after/plugin/jabs.lua
deleted file mode 100644
index 123de41..0000000
--- a/after/plugin/jabs.lua
+++ /dev/null
@@ -1,23 +0,0 @@
-local status_ok, jabs = pcall(require, "jabs")
-if not status_ok then
- return
-end
-
-jabs.setup {
- offset = { bottom = 2, right = 2 },
-
- symbols = {
- current = "@",
- split = "|",
- alternate = "*",
- hidden = "\\",
- locked = "=",
- ro = "=",
- edited = "+",
- terminal = ">_",
- default_file = "~",
- terminal_symbol = ">_",
- },
-
- use_devicons = false,
-}
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua
deleted file mode 100644
index c74eaab..0000000
--- a/after/plugin/lsp.lua
+++ /dev/null
@@ -1,92 +0,0 @@
-local status_ok, lspconfig = pcall(require, "lspconfig")
-if not status_ok then
- return
-end
-
--- configure lsp when attached
-local function lsp_attach(client, bufnr)
- -- helper functions
- local function set_lsp_sign(name, text)
- vim.fn.sign_define(name, { text = text, texthl = name })
- end
-
- local function map(m, lhs, rhs)
- local opts = { remap = false, silent = true, buffer = bufnr }
- vim.keymap.set(m, lhs, rhs, opts)
- end
- set_lsp_sign("DiagnosticSignError", "x")
- set_lsp_sign("DiagnosticSignWarn" , "!")
- set_lsp_sign("DiagnosticSignInfo" , "i")
- set_lsp_sign("DiagnosticSignHint" , "h")
-
- -- LSP actions
- map('n', 'K', 'lua vim.lsp.buf.hover()')
- map('n', 'gD', 'lua vim.lsp.buf.definition()')
- -- map('n', 'gD', 'lua vim.lsp.buf.declaration()')
- map('n', 'gI', 'lua vim.lsp.buf.implementation()')
- map('n', 'gY', 'lua vim.lsp.buf.type_definition()')
- map('n', 'gR', 'lua vim.lsp.buf.references()')
- map('n', '', 'lua vim.lsp.buf.signature_help()')
- map('n', 'lr', 'lua vim.lsp.buf.rename()')
- map('n', '', 'lua vim.lsp.buf.rename()')
- map('n', '', 'lua vim.lsp.buf.code_action()')
-
- -- Diagnostics
- map('n', '[d', 'lua vim.diagnostic.goto_prev()')
- map('n', ']d', 'lua vim.diagnostic.goto_next()')
-
- vim.api.nvim_buf_create_user_command(bufnr, 'LspFormat', function()
- vim.lsp.buf.format()
- end, {desc = 'Format buffer with language server'})
- vim.api.nvim_buf_create_user_command('LspWorkspaceAdd', function()
- vim.lsp.buf.add_workspace_folder()
- end, { desc = 'Add folder to workspace' })
- vim.api.nvim_buf_create_user_command('LspWorkspaceList', function()
- vim.notify(vim.inspect(vim.lsp.buf.list_workspace_folders()))
- end, { desc = 'List workspace folders' })
- vim.api.nvim_buf_create_user_command('LspWorkspaceRemove', function()
- vim.lsp.buf.remove_workspace_folder()
- end, { desc = 'Remove folder from workspace' })
-end
-
-vim.diagnostic.config({
- virtual_text = false,
- signs = true,
- update_in_insert = false,
- underline = true,
- severity_sort = true,
-})
-
-vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
- vim.lsp.handlers.hover, {
- border = 'solid',
- })
-
-vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
- vim.lsp.handlers.signature_help, {
- border = 'solid',
- })
-
--- get servers and attach to them
-local status_ok1, mason = pcall(require, "mason")
-if not status_ok1 then
- return
-end
-mason.setup {}
-
-local status_ok2, masonlspconfig = pcall(require, "mason-lspconfig")
-if not status_ok2 then
- return
-end
-masonlspconfig.setup {}
-masonlspconfig.setup_handlers {
- function (server_name)
- lspconfig[server_name].setup { on_attach = lsp_attach }
- end,
-
- -- specific servers can be setup as follows:
- -- ["rust_analyzer"] = function ()
- -- require("rust-tools").setup {}
- -- end
- -- check out :help mason-lspconfig for more info
-}
diff --git a/after/plugin/lsplines.lua b/after/plugin/lsplines.lua
deleted file mode 100644
index 25cee83..0000000
--- a/after/plugin/lsplines.lua
+++ /dev/null
@@ -1,13 +0,0 @@
-local status_ok, lines = pcall(require, "lsp_lines")
-if not status_ok then
- return
-end
-
-lines.setup()
-
-vim.diagnostic.config {
- virtual_lines = {
- highlight_whole_line = false,
- only_current_line = true
- }
-}
diff --git a/after/plugin/luasnip-choice.lua b/after/plugin/luasnip-choice.lua
deleted file mode 100644
index 5207721..0000000
--- a/after/plugin/luasnip-choice.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-local status_ok, lschoice = pcall(require, "cmp_luasnip_choice")
-if not status_ok then
- return
-end
-
-lschoice.setup {}
diff --git a/after/plugin/luasnip.lua b/after/plugin/luasnip.lua
deleted file mode 100644
index e0540ea..0000000
--- a/after/plugin/luasnip.lua
+++ /dev/null
@@ -1,15 +0,0 @@
-local status_ok, luasnip = pcall(require, "luasnip")
-if not status_ok then
- return
-end
-
-luasnip.config.set_config {
- -- return back into snippet
- history = true,
-
- -- update on text insert
- updateevents = "TextChanged,TextChangedI"
-}
-
-require("luasnip.loaders.from_vscode").lazy_load()
-require("luasnip.loaders.from_snipmate").lazy_load()
diff --git a/after/plugin/marks.lua b/after/plugin/marks.lua
deleted file mode 100644
index d09e9b2..0000000
--- a/after/plugin/marks.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-local status_ok, marks = pcall(require, "marks")
-if not status_ok then
- return
-end
-
-marks.setup {
- default_mappings = true,
-}
diff --git a/after/plugin/mason.lua b/after/plugin/mason.lua
deleted file mode 100644
index fe4895a..0000000
--- a/after/plugin/mason.lua
+++ /dev/null
@@ -1,29 +0,0 @@
-local status_ok, mason = pcall(require, "mason")
-if not status_ok then
- return
-end
-
-mason.setup {
- ui = {
- border = "shadow",
- width = 0.6,
- height = 0.9,
-
- icons = {
- package_installed = "+",
- package_pending = "?",
- package_uninstalled = "x"
- }
- },
- keymaps = {
- toggle_package_expand = "",
- install_package = "i", -- Keymap to install the package under the current cursor position
- update_package = "u", -- Keymap to reinstall/update the package under the current cursor position
- check_package_version = "c", -- Keymap to check for new version for the package under the current cursor position
- update_all_packages = "U", -- Keymap to update all installed packages
- check_outdated_packages = "C", -- Keymap to check which installed packages are outdated
- uninstall_package = "r", -- Keymap to uninstall a package
- cancel_installation = "", -- Keymap to cancel a package installation
- apply_language_filter = "", -- Keymap to apply language filter
- },
-}
diff --git a/after/plugin/masontool.lua b/after/plugin/masontool.lua
deleted file mode 100644
index 440b64d..0000000
--- a/after/plugin/masontool.lua
+++ /dev/null
@@ -1,17 +0,0 @@
-local status_ok, masontool = pcall(require, "mason-tool-installer")
-if not status_ok then
- return
-end
-
-masontool.setup {
- ensure_installed = {
- 'lua-language-server',
- 'bash-language-server',
- 'editorconfig-checker',
- 'stylua',
- 'shellcheck',
- 'clangd',
- 'html-lsp',
- 'css-lsp',
- },
-}
diff --git a/after/plugin/neogen.lua b/after/plugin/neogen.lua
deleted file mode 100644
index 44f072a..0000000
--- a/after/plugin/neogen.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-local status_ok, neogen = pcall(require, "neogen")
-if not status_ok then
- return
-end
-
-neogen.setup {
- enabled = true,
- input_after_comment = true,
- snippet_engine = "luasnip",
-}
diff --git a/after/plugin/neorg.lua b/after/plugin/neorg.lua
deleted file mode 100644
index 21a6c0e..0000000
--- a/after/plugin/neorg.lua
+++ /dev/null
@@ -1,65 +0,0 @@
-local status_ok, neorg = pcall(require, "neorg")
-if not status_ok then
- return
-end
-
-local status_ok2, luarocks = pcall(require, "luarocks-nvim")
-if not status_ok2 then
- return
-end
-
-luarocks.setup {}
-
-local wsphome = (os.getenv("XDG_DOCUMENTS_DIR") or
- (os.getenv("HOME").."/Documents")).."/notes/"
-neorg.setup {
- load = {
- ["core.defaults"] = {},
- ["core.esupports.metagen"] = {
- config = {
- type = "auto",
- update_date = true,
- }
- },
- ["core.dirman"] = {
- config = {
- workspaces = {
- home = wsphome.."home",
- robotics = wsphome.."robotics",
- school = wsphome.."school"
- },
- index = "index.norg",
- default_workspace = "home"
- }
- },
- ["core.summary"] = {},
- ["core.concealer"] = {
- config = {
- dim_code_blocks = {
- padding = { right = 2, },
- content_only = false,
- width = "content",
- },
- folds = false,
- icon_preset = "basic",
- }
- },
- ["core.export"] = {},
- ["core.completion"] = {
- config = {
- engine = "nvim-cmp",
- }
- },
- ["core.qol.toc"] = {
- config = {
- close_after_use = true
- }
- },
- ["core.presenter"] = {
- config = {
- zen_mode = "zen-mode",
- }
- },
- ["core.integrations.telescope"] = {},
- }
-}
diff --git a/after/plugin/notify.lua b/after/plugin/notify.lua
deleted file mode 100644
index 5d27a7c..0000000
--- a/after/plugin/notify.lua
+++ /dev/null
@@ -1,32 +0,0 @@
-local status_ok, notify = pcall(require, "notify")
-if not status_ok then
- return
-end
-
-notify.setup {
- timeout = 3000,
- minimum_width = 35,
- icons = {
- DEBUG = "B",
- ERROR = "x",
- INFO = "i",
- TRACE = "t",
- WARN = "!"
- },
-
- max_height = function() return math.floor(vim.o.lines * 0.75) end,
- max_width = function() return math.floor(vim.o.columns * 0.5) end,
- on_open = function(win, record)
- if record.title[1] == '' then record.title[1] = 'Unkown' end
- vim.api.nvim_win_set_config(win, {
- title = {
- { ' '..record.title[1]..' ', 'Notify'..record.level..'Title' }
- },
- title_pos = 'center',
- border = 'single'
- })
- end,
- render = function(bufnr, notif)
- vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, notif.message)
- end,
-}
diff --git a/after/plugin/project.lua b/after/plugin/project.lua
deleted file mode 100644
index 0f61ec0..0000000
--- a/after/plugin/project.lua
+++ /dev/null
@@ -1,20 +0,0 @@
-local status_ok, project = pcall(require, "project_nvim")
-if not status_ok then
- return
-end
-
-project.setup {
- detection_methods = { "pattern", "lsp" },
- patterns = {
- ".git",
- "Makefile",
- "_darcs",
- ".hg",
- ".bzr",
- ".svn",
- "package.json",
- "index.norg"
- },
- show_hidden = false,
- scope = "tab"
-}
diff --git a/after/plugin/sfm.lua b/after/plugin/sfm.lua
deleted file mode 100644
index 5b2e776..0000000
--- a/after/plugin/sfm.lua
+++ /dev/null
@@ -1,47 +0,0 @@
-local status_ok, sfm = pcall(require, "sfm")
-if not status_ok then
- return
-end
-
-sfm.setup {
- view = {
- side = 'right',
- width = 35,
- },
- mappings = {
- custom_only = false,
- list = {
- { key = 's', action = 'toggle_selection' }
- }
- },
- renderer = {
- icons = {
- file = {
- default = "#",
- symlink = "#",
- },
- folder = {
- default = "[|",
- open = "[/",
- symlink = "[|",
- symlink_open = "[/",
- },
- indicator = {
- folder_closed = "",
- folder_open = "",
- file = "",
- },
- selection = "*"
- }
- }
-}:load_extension('sfm-git', {
- icons = {
- unstaged = "+",
- staged = "S",
- unmerged = "U",
- renamed = "r",
- untracked = "?",
- deleted = "-",
- ignored = "?",
- }
-})
diff --git a/after/plugin/smartsplits.lua b/after/plugin/smartsplits.lua
deleted file mode 100644
index 54fc07c..0000000
--- a/after/plugin/smartsplits.lua
+++ /dev/null
@@ -1,28 +0,0 @@
-local status_ok, smartsplits = pcall(require, "smart-splits")
-if not status_ok then
- return
-end
-
-smartsplits.setup {
- default_amount = 3,
- resize_mode = {
- quit_key = 'r',
- resize_keys = {
- '',
- '',
- '',
- '',
- },
- silent = true,
- hooks = {
- on_enter = function()
- vim.notify("Resize mode on", vim.log.levels.INFO, { title = "Smart Splits" })
- vim.cmd('unmap r')
- end,
- on_leave = function()
- vim.notify("Resize Mode off", vim.log.levels.INFO, { title = "Smart Splits" })
- vim.keymap.set('n', 'r', smartsplits.start_resize_mode, {})
- end,
- },
- },
-}
diff --git a/after/plugin/startpage.lua b/after/plugin/startpage.lua
deleted file mode 100644
index afd93dc..0000000
--- a/after/plugin/startpage.lua
+++ /dev/null
@@ -1,115 +0,0 @@
-local status_ok, alpha = pcall(require, "alpha")
-if not status_ok then
- return
-end
-
-local function button(sc, txt, cmd, kopts, opts)
- opts = opts or {
- position = "center",
- shortcut = sc:gsub("", "LDR"),
- cursor = 0,
- width = 49,
- align_shortcut = "right",
- hl_shortcut = "AlphaShortcut",
- hl = "AlphaText",
- }
- if cmd then
- kopts = kopts or { noremap = true, silent = true, nowait = true }
- opts.keymap = { "n", sc, cmd, kopts }
- end
-
- local function on_press()
- local key = vim.api.nvim_replace_termcodes(cmd, true, false, true)
- vim.api.nvim_feedkeys(key, "t", false)
- end
-
- return {
- type = "button",
- val = txt,
- opts = opts,
- on_press = on_press,
- }
-end
-
-local header = {
- '█▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀█ █▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀█ ',
- '█ ░█████▀▀▀▀▀█████▓▄ ▀▀▀▀ ░ ░█ ░█ ░█ █ ',
- '█ ▒███████ ▓███████ ▒██ ▓███ ▓███ ▓███ █ ',
- '█ ▓███████ ▓███████ ▓█████████████████ █ ',
- '█ ▓███████ ▓███████ ███ ██████████████ █ ',
- '█ ▓███████ ▓███████ ███ ██████████████ █ ',
- '█ ▓███████ ▓███████ ███ ██████████████ █ ',
- '█ ▓███████ ▓███████ ███▄██████████████ █ ',
- '█ ▓███████ ▓███████ ██████▀▀██████████ █ ',
- '▀ ▓███████ ▓███████▄ ▄▄███████████ █ ',
- '█ ▓███████ ██████████████████ █▄▄▄',
- '█ ▓███████▀▀ ▀ ▀ ▀████████████████▄ ▄ █',
- '█▄▄▄▄▄▄▄ ▀ █▀▀▀▀▀▀▀▀▀▀▀▀█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█',
- ' █ ▀ █ ',
- ' ▀▀▀▀▀ ',
-}
-local footer = {
- '▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄',
-}
-
-alpha.setup {
- layout = {
- { type = 'text', val = function()
- local padding = {}
- for i = 1, math.floor((vim.api.nvim_win_get_height(0) - #header - 6 - #footer) / 2), 1 do
- table.insert(padding, " ")
- end
- return padding
- end },
- { type = 'text', val = header, opts = {
- position = 'center',
- hl = 'AlphaHeader',
- } },
- { type = 'padding', val = 1 },
- { type = 'group', val = {
- button('f', '? Find files', 'Telescope find_files'),
- button('r', '↺ Recent files', 'Telescope oldfiles '),
- button('n', '▣ Neorg workspace', 'Telescope neorg switch_workspace'),
- button('m', '≡ Menu', 'lua require("core.conf").configmenu()'),
- button('q', '✖ Quit', 'wqa'),
- } },
- { type = 'text', val = footer, opts = {
- position = 'center',
- hl = 'AlphaFooter',
- } },
- },
- opts = {
- keymap = {
- press = '',
- press_queue = nil
- },
- setup = function()
- vim.api.nvim_create_autocmd('User', {
- pattern = 'AlphaReady',
- desc = 'disable stuff for alpha',
- callback = function()
- vim.opt.laststatus = 0
- vim.opt.showtabline = 0
- vim.opt.more = false
- vim.opt.showcmd = false
- vim.opt.ruler = false
- vim.opt.number = false
- vim.opt.relativenumber = false
- end,
- })
- vim.api.nvim_create_autocmd('BufUnload', {
- buffer = 0,
- desc = 'enable stuff after alpha closes',
- callback = function()
- vim.opt.laststatus = 3
- vim.opt.showtabline = 2
- vim.opt.more = true
- vim.opt.showcmd = true
- vim.opt.ruler = true
- vim.opt.number = false
- vim.opt.relativenumber = false
- end,
- })
- end,
- }
-}
diff --git a/after/plugin/statusline.lua b/after/plugin/statusline.lua
deleted file mode 100644
index e1a27de..0000000
--- a/after/plugin/statusline.lua
+++ /dev/null
@@ -1,78 +0,0 @@
-local status_ok, el = pcall(require, "el")
-if not status_ok then
- return
-end
-
-el.reset_windows()
-
-local builtin = require("el.builtin")
-local sections = require("el.sections")
-local c = require("core.statusbar.components")
-
-local function hl(fg, b)
- b = b or false
- return c.extract_hl({
- bg = { ["StatusLine"] = "bg" },
- fg = { [fg] = "fg" },
- bold = b,
- })
-end
-
-local modes = {
- -- display name, mode, highlight group
- n = { "Normal", "N", hl("@neorg.headings.1.title") },
- niI = { "Normal", "N", hl("@neorg.headings.1.title") },
- niR = { "Normal", "N", hl("@neorg.headings.1.title") },
- niV = { "Normal", "N", hl("@neorg.headings.1.title") },
- no = { "N·OpPd", "?" },
- v = { "Visual", "V", hl("@neorg.headings.2.title") },
- V = { "V·Line", "Vl", hl("@neorg.headings.2.title") },
- [""] = { "V·Block", "Vb", hl("@neorg.headings.2.title") },
- s = { "Select", "S" },
- S = { "S·Line", "Sl" },
- [""] = { "S·Block", "Sb" },
- i = { "Insert", "I", hl("@neorg.headings.4.title") },
- ic = { "ICompl", "Ic" },
- R = { "Replace", "R", hl("@neorg.headings.5.title") },
- Rv = { "VReplace", "Rv", hl("@neorg.headings.5.title") },
- c = { "Command", "C", hl("@neorg.headings.3.title") },
- cv = { "Vim Ex", "E" },
- ce = { "Ex (r)", "E" },
- r = { "Prompt", "P" },
- rm = { "More", "M" },
- ["r?"] = { "Confirm", "Cn" },
- ["!"] = { "Shell", "S" },
- nt = { "Term", "T" },
- t = { "Term", "T" },
-}
-
-el.setup {
- generator = function()
- return {
- { { " " }, c.mode { modes = modes, hl_icon_only = false } },
- { sections.split, required = true },
- { sections.collapse_builtin { { builtin.filetype }, { " " } } },
- { sections.maximum_width(c.fn_tail, 0.50), required = true },
- { sections.collapse_builtin { { " " }, { builtin.modified_flag } } },
- { sections.split, required = true },
- { c.lsp_srvname },
- { c.diagnostics {
- fmt = "[%s]",
- hl_err = hl("DiagnosticError", true),
- hl_warn = hl("DiagnosticWarn", true),
- hl_info = hl("DiagnosticInfo", true),
- hl_hint = hl("DiagnosticHint", true)
- }},
- { c.git_branch { icon = "*", fmt = " %s%s" } },
- { c.git_changes_buf {
- fmt = "[%s]",
- hl_insert = hl("GitSignsAdd", true),
- hl_change = hl("GitSignsChange", true),
- hl_delete = hl("GitSignsDelete", true),
- }},
- { { " " }, c.line {
- fmt = "[%s]",
- }, required = true },
- }
- end
-}
diff --git a/after/plugin/tabline.lua b/after/plugin/tabline.lua
deleted file mode 100644
index a9281a5..0000000
--- a/after/plugin/tabline.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-local status_ok, tabline = pcall(require, "tar")
-if not status_ok then
- return
-end
-
-tabline.setup {
- closeicon = "%#Constant#[x]"
-}
diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua
deleted file mode 100644
index 31c4a0b..0000000
--- a/after/plugin/telescope.lua
+++ /dev/null
@@ -1,97 +0,0 @@
-local status_ok, telescope = pcall(require, "telescope")
-if not status_ok then
- return
-end
-local actions = require('telescope.actions')
-local action_layout = require("telescope.actions.layout")
-
-local function telescopew()
- if vim.o.columns <= 80 then
- return vim.o.columns
- else
- return 0.8
- end
-end
-
-telescope.setup {
- defaults = {
- borderchars = {
- prompt = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
- results = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
- preview = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
- },
- winblend = 0,
- layout_strategy = 'horizontal',
- sorting_strategy = 'descending',
- scroll_strategy = 'limit',
- layout_config = {
- horizontal = {
- width = telescopew(),
- height = 20,
- prompt_position = 'bottom',
- anchor = 'N',
- }
- },
- preview = {
- -- add image previews via chafa
- mime_hook = function(filepath, bufnr, opts)
- local function is_image(filepath)
- local image_extensions = { -- supported image formats
- 'png',
- 'jpg',
- 'jpe',
- 'jpeg',
- 'webp',
- 'gif'
- }
- local split_path = vim.split(filepath:lower(), '.', { plain=true })
- local extension = split_path[#split_path]
- return vim.tbl_contains(image_extensions, extension)
- end
- if is_image(filepath) and vim.fn.executable('chafa') == 1 then
- local term = vim.api.nvim_open_term(bufnr, {})
- local function send_output(_, data, _)
- for _, d in ipairs(data) do
- vim.api.nvim_chan_send(term, d..'\r\n')
- end
- end
- vim.fn.jobstart({
- 'chafa', '-C', 'on', '--animate', 'off', '-s',
- '23x18', '--clear', filepath
- }, { on_stdout = send_output, stdout_buffered = true, pty = true })
- a.nvim_set_option_value("number", false, { buf = bufnr })
- else
- require("telescope.previewers.utils").set_preview_message(bufnr,
- opts.winid, "File cannot be previewed")
- end
- end
- },
- mappings = {
- i = {
- [""] = actions.close,
- [''] = 'which_key',
- [''] = actions.move_selection_next,
- [''] = actions.move_selection_previous,
- [''] = actions.select_default,
- [''] = actions.preview_scrolling_up,
- [''] = actions.preview_scrolling_down,
- [""] = action_layout.toggle_preview
- },
- n = {
- ["gg"] = actions.move_to_top,
- ["G"] = actions.move_to_bottom,
- },
- },
- }
-}
-telescope.load_extension('file_browser')
-telescope.load_extension('projects')
-telescope.load_extension('fzf')
-telescope.load_extension('harpoon')
-
-a.nvim_create_autocmd('User', {
- pattern = 'TelescopePreviewerLoaded',
- callback = function()
- vim.opt.winblend = 0
- end,
-})
diff --git a/after/plugin/todo-comments.lua b/after/plugin/todo-comments.lua
deleted file mode 100644
index cf1c0a0..0000000
--- a/after/plugin/todo-comments.lua
+++ /dev/null
@@ -1,36 +0,0 @@
-local status_ok, todocomments = pcall(require, "todo-comments")
-if not status_ok then
- return
-end
-
-todocomments.setup {
- keywords = {
- FIX = {
- icon = "# ",
- alt = { "FIXME", "BUG" },
- },
- HACK = {
- icon = "* ",
- color = "warning",
- },
- WARN = {
- icon = "! ",
- color = "warning",
- alt = { "WARNING", "XXX" },
- },
- NOTE = {
- icon = "i ",
- color = "hint",
- alt = { "INFO", "TODO" },
- },
- PERF = {
- icon = "@ ",
- alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" },
- },
- TEST = {
- icon = "@ ",
- color = "test",
- alt = { "TESTING", "PASSED", "FAILED" },
- },
- },
-}
diff --git a/after/plugin/ts.lua b/after/plugin/ts.lua
deleted file mode 100644
index 0494b3b..0000000
--- a/after/plugin/ts.lua
+++ /dev/null
@@ -1,36 +0,0 @@
-local status_ok, treesitter = pcall(require, "nvim-treesitter.configs")
-if not status_ok then
- return
-end
-
-treesitter.setup {
- ensure_installed = {
- "c",
- "lua",
- "bash",
- "vim",
- "vimdoc",
- "query",
- "git_rebase",
- "gitattributes",
- "gitcommit",
- "gitignore",
- "git_config",
- },
-
- highlight = {
- enable = true,
- additional_vim_regex_highlighting = false,
- disable = function(lang, buf)
- if lang == "diff" then return true end
- local max_filesize = 1024 * 100 -- 100 KB
- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
- if ok and stats and stats.size > max_filesize then
- return true
- end
- end
- },
- indent = {
- enable = true
- }
-}
diff --git a/after/plugin/tsc.lua b/after/plugin/tsc.lua
deleted file mode 100644
index 70131e7..0000000
--- a/after/plugin/tsc.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-local status_ok, tc = pcall(require, "treesitter-context")
-if not status_ok then
- return
-end
-
-tc.setup{
- enable = true,
- line_numbers = true,
- separator = '-',
-}
diff --git a/after/plugin/tsj.lua b/after/plugin/tsj.lua
deleted file mode 100644
index 8465a40..0000000
--- a/after/plugin/tsj.lua
+++ /dev/null
@@ -1,9 +0,0 @@
-local status_ok, treesj = pcall(require, "treesj")
-if not status_ok then
- return
-end
-
-treesj.setup {
- use_default_keymaps = false,
- max_join_length = 120,
-}
diff --git a/after/plugin/undotree.lua b/after/plugin/undotree.lua
deleted file mode 100644
index ece04b4..0000000
--- a/after/plugin/undotree.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-if (g.loaded_undotree) then
- g.undotree_DiffAutoOpen = 0
-end
diff --git a/after/plugin/urlview.lua b/after/plugin/urlview.lua
deleted file mode 100644
index 1cae07c..0000000
--- a/after/plugin/urlview.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-local status_ok, urlview = pcall(require, "urlview")
-if not status_ok then
- return
-end
-
-urlview.setup {
- default_picker = 'telescope',
-}
diff --git a/after/plugin/whichkey.lua b/after/plugin/whichkey.lua
deleted file mode 100644
index 752bc95..0000000
--- a/after/plugin/whichkey.lua
+++ /dev/null
@@ -1,21 +0,0 @@
-local status_ok, whichkey = pcall(require, "which-key")
-if not status_ok then
- return
-end
-
-whichkey.setup {
- icons = {
- breadcrumb = '>>',
- separator = '->',
- },
- winblend = 0,
- window = {
- border = 'shadow',
- margin = { 1, .1, 2, .1 },
-
- },
- layout = {
- width = { min = 20, max = 50 },
- align = 'center',
- }
-}
diff --git a/colors/mellow.ext.lua b/colors/mellow.ext.lua
deleted file mode 100644
index 44e2597..0000000
--- a/colors/mellow.ext.lua
+++ /dev/null
@@ -1,89 +0,0 @@
-vim.cmd('runtime mellow')
-local function highlight(group, opts, space)
- space = space or 0
-
- if type(group) == 'table' then
- for i in pairs(group) do
- a.nvim_set_hl(space, group[i], opts)
- end
- elseif type(group) == 'string' then
- a.nvim_set_hl(space, group, opts)
- end
-end
-
-local function cpyhl(hlgroup)
- local ok, hl = pcall(vim.api.nvim_get_hl_by_name, hlgroup, true)
- if not ok then return end
- for _, key in pairs({"foreground", "background", "special"}) do
- if hl[key] then
- hl[key] = string.format("#%06x", hl[key])
- end
- end
- return hl
-end
-
-local function getcolor(index, fallback)
- return vim.g['terminal_color_' .. index] or fallback
-end
-
-local colors = {
- black = getcolor(0, 'Black'),
- red = getcolor(1, 'Red'),
- green = getcolor(2, 'Green'),
- yellow = getcolor(3, 'Yellow'),
- blue = getcolor(4, 'Blue'),
- magenta = getcolor(5, 'Magenta'),
- cyan = getcolor(6, 'Cyan'),
- white = getcolor(7, 'White'),
- bright_black = getcolor(8, 'DarkGrey'),
- bright_red = getcolor(9, 'LightRed'),
- bright_green = getcolor(10, 'LightGreen'),
- bright_yellow = getcolor(11, 'LightYellow'),
- bright_blue = getcolor(12, 'LightBlue'),
- bright_magenta = getcolor(13, 'LightMagenta'),
- bright_cyan = getcolor(14, 'LightCyan'),
- bright_white = getcolor(15, 'LightGray'),
-}
-
-if pcall(require, "mellow") then c = require('mellow.colors').dark end
-
--- remove tildas
-highlight('EndOfBuffer', { fg = vim.g.terminal_color_background })
-
--- make all backgrounds the same color
-highlight('NormalNC', cpyhl('Normal'))
-
-highlight('NormalFloat', { bg = c.bg_dark })
-highlight('FloatBorder', cpyhl('NormalFloat'))
-
--- plugin highlights ----------------------------------------------------------
--- telescope
-highlight('TelescopeMatching', { fg = c.yellow })
-
--- alpha
-highlight('AlphaHeader', { fg = colors.blue })
-highlight('AlphaText', { fg = colors.blue })
-highlight('AlphaShortcut', { bold = true })
-highlight('AlphaFooter', { fg = colors.blue })
-
--- fidget
-highlight('FidgetTask', { fg = vim.g.terminal_color_foreground })
-
--- sfm
-highlight("SFMNormal", { bg = c.bg_dark })
-highlight("SFMNormalNC", cpyhl("SFMNormal"))
-highlight("SFMSignColumn", cpyhl("SFMNormal"))
-
--- norg + headings
-highlight({ "@neorg.headings.1.title", "@neorg.headings.1.icon" },
- { fg = colors.yellow, bg = '#2a211c' })
-highlight({ "@neorg.headings.2.title", "@neorg.headings.2.icon" },
- { fg = colors.blue, bg = '#201e25' })
-highlight({ "@neorg.headings.3.title", "@neorg.headings.3.icon" },
- { fg = colors.cyan, bg = '#2b1b20' })
-highlight({ "@neorg.headings.4.title", "@neorg.headings.4.icon" },
- { fg = colors.green, bg = '#1d201e' })
-highlight({ "@neorg.headings.5.title", "@neorg.headings.5.icon" },
- { fg = colors.magenta, bg = '#251a21' })
-highlight({ "@neorg.headings.6.title", "@neorg.headings.6.icon" },
- { fg = colors.white, bg = '#212126' })
diff --git a/extras/JavaVersion.java b/extras/JavaVersion.java
new file mode 100644
index 0000000..5e4a4c7
--- /dev/null
+++ b/extras/JavaVersion.java
@@ -0,0 +1,13 @@
+/*
+ * JavaVersion returns the version of java interpreter running it. Inspired by
+ * "libraries/javacheck/JavaCheck.java" in PrismLauncher.
+ */
+public final class JavaVersion {
+ public static void main(String[] args) {
+ String p = System.getProperty("java.version");
+ if (p != null)
+ System.out.println(p);
+ else
+ System.exit(1);
+ }
+}
diff --git a/init.lua b/init.lua
index 74ff9d8..4ddd8fc 100644
--- a/init.lua
+++ b/init.lua
@@ -1,25 +1,39 @@
--- shorthands -----------------------------------------------------------------
-o = vim.opt
-a = vim.api
-g = vim.g
-c = vim.cmd
-
--- performance ----------------------------------------------------------------
+-- enable performance stuff
vim.loader.enable()
--- main lua files -------------------------------------------------------------
-misc = require('core.misc')
-misc.include('bootstrap')
-misc.include('conf')
--- core lua files -------------------------------------------------------------
-misc.include('core.conf')
-misc.include('core.context')
-
--- call all snippets in the lua/snippets directory ----------------------------
-if pcall(require, "luasnip") then
- misc.include('snippet.shorthands')
- for _, file in ipairs(vim.fn.readdir(vim.fn.stdpath('config')..'/lua/snippet',
- [[v:val =~ '\.lua$']])) do
- require('snippet.'..file:gsub('%.lua$', ''))
- end
+-- bootstrap plugin manager
+local path = vim.fn.stdpath("data").."/site/pack/deps/opt/dep"
+if vim.fn.empty(vim.fn.glob(path)) > 0 then
+ vim.fn.system({ "git", "clone", "--depth=1", "https://git.squi.bid/dep", path })
end
+vim.cmd("packadd dep")
+
+-- load miscellaneous utilities
+local misc = require('core.misc')
+
+-- load user config
+misc.include('conf.opts') -- setup options
+misc.include('conf.binds') -- setup keybinds
+misc.include('conf.autos') -- setup autos
+misc.include('conf.context') -- setup context menu
+
+-- load plugins
+require('dep') {
+ { 'squibid/dep',
+ url = 'https://git.squi.bid/dep'
+ },
+
+ load = function()
+ -- aquire all plugin specs
+ local plugs = {}
+
+ for _, file in ipairs(vim.api.nvim_get_runtime_file("lua/conf/plugins/*.lua", true)) do
+ local ret = misc.include('conf.plugins.'..file:gsub('^.*/', ''):gsub('%.lua$', ''))
+ if type(ret) ~= "boolean" then
+ plugs[#plugs + 1] = ret
+ end
+ end
+
+ return plugs
+ end
+}
diff --git a/lua/.luarc.json b/lua/.luarc.json
deleted file mode 100644
index 8d322a3..0000000
--- a/lua/.luarc.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "diagnostics.globals": [
- "g",
- "o",
- "a",
- "vim",
- ],
- "workspace.checkThirdParty": false
-}
diff --git a/lua/bootstrap.lua b/lua/bootstrap.lua
deleted file mode 100644
index f522833..0000000
--- a/lua/bootstrap.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-local path = vim.fn.stdpath("data").."/site/pack/deps/opt/dep"
-if vim.fn.empty(vim.fn.glob(path)) > 0 then
- vim.fn.system({ "git", "clone", "--depth=1", "https://git.squi.bid/dep", path })
-end
-vim.cmd("packadd dep")
diff --git a/lua/conf/auto.lua b/lua/conf/auto.lua
deleted file mode 100644
index 0ab1a86..0000000
--- a/lua/conf/auto.lua
+++ /dev/null
@@ -1,87 +0,0 @@
-local function auto(event, opts)
- a.nvim_create_autocmd(event, opts)
-end
-
-local function augroup(name, opts)
- opts = opts or {}
- opts['clear'] = true
- a.nvim_create_augroup(name, opts)
-end
-
-local winchange = augroup('winchange')
-local bufcheck = augroup('bufcheck')
-local toggles = augroup('toggles')
-
-auto({ "FocusGained", "TermClose", "TermLeave" }, {
- group = bufcheck,
- desc = 'Update contents of file.',
- command = "checktime",
-})
-
-auto("VimResized", {
- group = winchange,
- desc = 'Resize splits when window is resized.',
- callback = function()
- local current_tab = vim.fn.tabpagenr()
- vim.cmd("tabdo wincmd =")
- vim.cmd("tabnext " .. current_tab)
- end,
-})
-
-auto('TextYankPost', {
- group = bufcheck,
- pattern = '*',
- desc = 'Highlight on yank.',
- callback = function()
- vim.highlight.on_yank{ timeout = 250 }
- end
-})
-
-auto('BufRead', {
- pattern = '*',
- group = bufcheck,
- desc = 'Return to the last place the buffer was closed in.',
- callback = function() vim.cmd([[call setpos(".", getpos("'\""))]]) end
-})
-
-auto('FileType', {
- pattern = { 'gitcommit', 'markdown' },
- desc = 'Spell checking and wrapping in commit buffers and markdown files.',
- callback = function()
- vim.opt_local.wrap = true
- vim.opt_local.spell = true
- end
-})
-
-auto('BufWritePre', {
- pattern = '*',
- group = bufcheck,
- desc = 'Basically mkdir -p.',
- callback = function(ctx)
- if ctx.match:match("^%w%w+://") then return end
- local dir = vim.fn.fnamemodify(ctx.file, ':p:h')
- vim.fn.mkdir(dir, 'p')
- end
-})
-
-auto('WinLeave', {
- desc = 'Unset cursorline',
- group = toggles,
- callback = function() vim.opt.cursorline = false end
-})
-
-auto('WinEnter', {
- desc = 'Set cursorline',
- group = toggles,
- callback = function()
- if vim.bo.filetype ~= 'alpha' then
- vim.opt.cursorline = true
- end
- end
-})
-
-auto('ColorScheme', {
- desc = 'Update statusline on colorscheme change',
- group = winchange,
- callback = function() require('el').reset_windows() end
-})
diff --git a/lua/conf/autos.lua b/lua/conf/autos.lua
new file mode 100644
index 0000000..51ed58a
--- /dev/null
+++ b/lua/conf/autos.lua
@@ -0,0 +1,50 @@
+local misc = require('core.misc')
+local auto, augroup = misc.auto, misc.augroup
+
+-- auto commands which interact with bufferes without modifying them
+local bufcheck = augroup('bufcheck')
+-- auto commands which modify things on the filesystem
+local fsmod = augroup('fsmod')
+
+auto('FocusGained', {
+ group = bufcheck,
+ desc = 'Update contents of file.',
+ command = 'checktime',
+})
+
+auto('TextYankPost', {
+ pattern = '*',
+ group = bufcheck,
+ desc = 'Highlight on yank.',
+ callback = function()
+ vim.highlight.on_yank { timeout = 250 }
+ end
+})
+
+auto('BufRead', {
+ pattern = '*',
+ group = bufcheck,
+ desc = 'Return to the last place the buffer was closed in.',
+ callback = function()
+ vim.cmd([[call setpos(".", getpos("'\""))]])
+ vim.api.nvim_input('zz')
+ end
+})
+
+auto('BufWritePre', {
+ pattern = '*',
+ group = fsmod,
+ desc = 'remove trailing spaces on file save',
+ command = [[%s/\s\+$//e]]
+})
+
+auto('BufWritePre', {
+ pattern = '*',
+ group = fsmod,
+ desc = 'Basically mkdir -p.',
+ callback = function(ctx)
+ if ctx.match:match("^%w%w+://") then return end
+ local dir = vim.fn.fnamemodify(ctx.file, ':p:h')
+ vim.fn.mkdir(dir, 'p')
+ end
+})
diff --git a/lua/conf/binds.lua b/lua/conf/binds.lua
index 42c609e..2031852 100644
--- a/lua/conf/binds.lua
+++ b/lua/conf/binds.lua
@@ -1,25 +1,11 @@
-local conf = require('core.conf')
+local misc = require('core.misc')
+local map, auto = misc.map, misc.auto
-local function map(mode, bind, cmd, opts)
- opts = opts or {}
- opts['noremap'] = true
- opts['silent'] = true
-
- if type(bind) == 'table' then
- for i in pairs(bind) do
- vim.keymap.set(mode, bind[i], cmd, opts)
- end
- elseif type(bind) == 'string' then
- vim.keymap.set(mode, bind, cmd, opts)
- end
-end
-
--- vim binds ------------------------------------------------------------------
-g.mapleader = ' ' -- set leader key
+-- vim binds
+vim.g.mapleader = ' ' -- set leader key
map('x', 'p', [["_dP]], { desc = 'Greatest remap of all time.' })
map('n', '', ':nohlsearch:echo', { desc = 'Clear search.' })
-map('t', '', '', { desc = 'make work in terminals.' })
-- move selected text up/down
map('v', '', ":m '<-2gv=gv", { desc = 'Move selected text up.' })
map('v', '', ":m '>+1gv=gv", { desc = 'Move selected text down.' })
@@ -45,22 +31,7 @@ map('n', 'x', function() -- execute order 111
else
vim.notify("File doesn't exist", vim.log.levels.INFO, { title = misc.appid })
end
-end)
-
--- add some keybinds to the file view (netrw)
-a.nvim_create_autocmd('FileType', {
- pattern = 'netrw',
- callback = function()
- local function bind(lhs, rhs)
- vim.keymap.set('n', lhs, rhs, { remap = true, buffer = true })
- end
- bind('h', '-^') -- Go up a directory
- bind('l', '') -- Go down a directory / open a file
- bind('.', 'gh') -- Toggle hidden files
- bind('P', 'z') -- Close preview window
- bind('', 'q') -- Close netrw
- end
-})
+end, { desc = 'toggle executable flag of the file' })
-- tabs
map('n', '[]', 'tabnew')
@@ -68,118 +39,22 @@ map('n', '][', 'tabc')
map('n', '[[', 'tabp')
map('n', ']]', 'tabn')
--- config binds ---------------------------------------------------------------
-map('n', 'm', conf.configmenu, { desc = 'Neovim config manager menu', })
-
--- plugin binds ---------------------------------------------------------------
-
--- pretty lsp view
-map('n', 'gd', 'Glance definitions')
-map('n', 'gr', 'Glance references')
-map('n', 'gy', 'Glance type_definitions')
-map('n', 'gi', 'Glance implementations')
-
-if pcall(require, "treesj") then
- local treesj = require('treesj') -- treesj
- map('n', 'j', treesj.toggle)
-end
-
-if pcall(require, "telescope") then
- local telebuilt = require('telescope.builtin') -- telescope
- -- local telexten = require('telescope').extensions
- map('n', 'sf', telebuilt.find_files, { desc = 'Find files.' })
- map('n', 'so', telebuilt.oldfiles, { desc = 'Find old files.' })
- map('n', 'sg', telebuilt.git_files, { desc = 'Find git files.' })
- -- search urls in buffer
- map('n', 'su', 'UrlView', { desc = 'Find urls in buffer.' })
- -- search lsp symbols
- map('n', 'ss', telebuilt.lsp_document_symbols,
- { desc = 'Find LSP Symbols.' })
- -- search for keybinds
- map('n', 'sk', telebuilt.keymaps,
- { desc = 'Find nvim Keymaps.' })
- -- search for highlights
- map('n', 'sh', telebuilt.highlights,
- { desc = 'Find nvim Highlights.' })
- -- search for autocommands
- map('n', 'sa', telebuilt.autocommands,
- { desc = 'Find nvim Autocommands.' })
- -- search for vim options
- map('n', 'sv', telebuilt.vim_options, { desc = 'Find vim options.' })
- -- search for string in project
- map('n', 'sp', telebuilt.live_grep, { desc = 'Find string in project.' })
-
- -- Code Actions (requires telescope)
- if pcall(require, "actions-preview") then
- map({ "n", "v" }, "ca", require("actions-preview").code_actions, {
- desc = 'preview code actions'
- })
+-- good spell suggestion ui
+-- (stolen from https://github.com/neovim/neovim/pull/25833)
+local spell_on_choice = vim.schedule_wrap(function(_, idx)
+ if type(idx) == 'number' then
+ vim.cmd('normal! ' .. idx .. 'z=')
end
-end
+end)
--- todo list
-if pcall(require, "todo-comments") then
- map("n", "td", "TodoQuickFix", { desc = 'open up list of TODO\'s' })
-end
-
--- harpoon
-if (pcall(require, 'harpoon')) then
- local harpoon = require("harpoon")
-
- map("n", "a", function()
- harpoon:list():append()
- vim.notify('added new file to quickmarks', vim.log.levels.INFO, {
- title = misc.appid,
- })
- end)
- map('n', '', function() harpoon:list():select(1) end)
- map('n', '', function() harpoon:list():select(2) end)
- map('n', '', function() harpoon:list():select(3) end)
- map('n', '', function() harpoon:list():select(4) end)
-
- map("n", "", function() harpoon:list():prev() end)
- map("n", "", function() harpoon:list():next() end)
-
- map("n", "", function() require("core.harpoon").switcher() end)
-end
-
-map('n', 'u', 'UndotreeToggle', { desc = 'Open undo tree.' })
-map('n', 'f', 'SFMToggle', { desc = 'Open file tree view.' })
-map('n', '', 'JABSOpen', { desc = 'Switch between buffers.' })
-
-if pcall(require, "smart-splits") then
- local smartsplits = require('smart-splits') -- resizing buffers (toggleable)
- map('n', 'r', smartsplits.start_resize_mode)
-end
-
--- neogen
-if pcall(require, "neogen") then
- map('n', 'df', require("neogen").generate, {
- desc = 'Generate anotations',
- })
-end
-
--- venn
-function _G.Toggle_venn()
- local mapb = vim.api.nvim_buf_set_keymap
- local venn_enabled = vim.inspect(vim.b.venn_enabled)
- if venn_enabled == "nil" then
- vim.notify("Enabled venn mode", vim.log.levels.LOW, { title = misc.appid })
- vim.b.venn_enabled = true
- vim.cmd([[setlocal ve=all]])
- -- draw a line on HJKL keystokes
- mapb(0, "n", "J", "j:VBox", { noremap = true })
- mapb(0, "n", "K", "k:VBox", { noremap = true })
- mapb(0, "n", "L", "l:VBox", { noremap = true })
- mapb(0, "n", "H", "h:VBox", { noremap = true })
- -- draw a box by pressing "f" with visual selection
- mapb(0, "v", "f", ":VBox", { noremap = true })
- else
- vim.notify("Disabled venn mode", vim.log.levels.LOW, { title = misc.appid })
- vim.cmd[[setlocal ve=]]
- vim.cmd[[mapclear ]]
- vim.b.venn_enabled = nil
+local spellsuggest_select = function()
+ if vim.v.count > 0 then
+ spell_on_choice(nil, vim.v.count)
+ return
end
+ local cword = vim.fn.expand('')
+ local prompt = 'Change ' .. vim.inspect(cword) .. ' to:'
+ vim.ui.select(vim.fn.spellsuggest(cword, vim.o.lines), { prompt = prompt }, spell_on_choice)
end
--- toggle keymappings for venn using v
-map('n', 'v', ":lua Toggle_venn()")
+
+vim.keymap.set('n', 'z=', spellsuggest_select, { desc = 'Shows spelling suggestions' })
diff --git a/lua/core/context.lua b/lua/conf/context.lua
similarity index 93%
rename from lua/core/context.lua
rename to lua/conf/context.lua
index 63463cd..b685afe 100644
--- a/lua/core/context.lua
+++ b/lua/conf/context.lua
@@ -7,6 +7,7 @@ vim.cmd([[:amenu PopUp.Save\ All\ Buffers :wa]])
vim.cmd([[:nmenu PopUp.Select\ All ggVG]])
vim.cmd([[:nmenu PopUp.Undo u]])
vim.cmd([[:nmenu PopUp.Redo ]])
+vim.cmd([[:nmenu PopUp.Inspect Inspect]])
vim.cmd([[:amenu PopUp.-1- ]]) -- dividers
vim.cmd([[:nmenu PopUp.Copy\ Line yy]])
vim.cmd([[:vmenu PopUp.Copy\ Selection y]])
diff --git a/lua/conf/init.lua b/lua/conf/init.lua
deleted file mode 100644
index 2029141..0000000
--- a/lua/conf/init.lua
+++ /dev/null
@@ -1,4 +0,0 @@
-misc.include('conf.plugins') -- load plugins first to allow colorscheme to be set in opts
-misc.include('conf.opts')
-misc.include('conf.binds')
-misc.include('conf.auto')
diff --git a/lua/conf/opts.lua b/lua/conf/opts.lua
index 0d0863c..91c8055 100644
--- a/lua/conf/opts.lua
+++ b/lua/conf/opts.lua
@@ -1,65 +1,50 @@
--- better ui ------------------------------------------------------------------
-if pcall(require, "notify") then vim.notify = require("notify") end
-o.colorcolumn = { 80 }
+-- color stuff
+if vim.fn.has("termguicolors") then
+ vim.opt.termguicolors = true
+end
-- buffer
-o.scrolloff = 5
-o.wrap = true -- wraping lines
-o.linebreak = true -- fix where line is wraped
-o.cursorline = true
-
--- statusbar
-o.laststatus = 3
-o.cmdheight = 1
-o.showmode = false -- stop vim from showing mode (we have a statusbar)
-
--- tabline
-o.showtabline = 2
+vim.opt.scrolloff = 5
+vim.opt.wrap = true -- wraping lines
+vim.opt.linebreak = true -- fix where line is wraped
+vim.opt.cursorline = true
-- indents + tabs
local tabwidth = 2
-o.expandtab = true
-o.smarttab = true
-o.cindent = true
-o.autoindent = true
-o.tabstop = tabwidth
-o.shiftwidth = tabwidth
-o.softtabstop = tabwidth
+vim.opt.expandtab = true
+vim.opt.smarttab = true
+vim.opt.cindent = true
+vim.opt.autoindent = true
+vim.opt.tabstop = tabwidth
+vim.opt.shiftwidth = tabwidth
+vim.opt.softtabstop = tabwidth
--- colorscheme
-if vim.fn.has("termguicolors") then
- o.termguicolors = true
-end
-misc.colorscheme('mellow')
+vim.opt.clipboard = 'unnamedplus' -- system clipboard
+vim.opt.updatetime = 200
--- better editing -------------------------------------------------------------
-o.clipboard = 'unnamedplus' -- system clipboard
-o.splitkeep = "screen" -- keep same text on screen when spliting
-o.updatetime = 200
+-- file saving
+vim.opt.swapfile = false
+vim.opt.undofile = true
+vim.opt.confirm = true
--- file saving ----------------------------------------------------------------
-o.swapfile = false
-o.undofile = true
-o.confirm = true
+-- searching
+vim.opt.ignorecase = true
+vim.opt.smartcase = true
+vim.opt.wrapscan = true
+vim.opt.showmatch = true
+vim.opt.incsearch = true
--- searching ------------------------------------------------------------------
-o.ignorecase = true
-o.smartcase = true
-o.wrapscan = true
-o.showmatch = true
-o.incsearch = true
+-- wild menus
+vim.opt.wildoptions = 'pum'
+vim.opt.pumblend = 3
+vim.opt.pumheight = 20
--- wild menus -----------------------------------------------------------------
-o.wildoptions = 'pum'
-o.pumblend = 3
-o.pumheight = 20
+vim.opt.wildignorecase = true
+vim.opt.wildignore = '*.o'
-o.wildignorecase = true
-o.wildignore = '*.o'
-
--- netrw ----------------------------------------------------------------------
-g.netrw_banner = 1
-g.netrw_localcopydircmd = 'cp -r'
-g.netrw_winsize = 30
-g.netrw_liststyle = 1
-g.netrw_preview = 1
+-- netrw
+vim.g.netrw_banner = 0
+vim.g.netrw_winsize = 30
+vim.g.netrw_liststyle = 1
+vim.g.netrw_sizestyle = "H"
+vim.g.netrw_hide = 1
diff --git a/lua/conf/plugins.lua b/lua/conf/plugins.lua
deleted file mode 100644
index 366b02f..0000000
--- a/lua/conf/plugins.lua
+++ /dev/null
@@ -1,167 +0,0 @@
-require('dep') {
- -- dep manages dep ----------------------------------------------------------
- { 'squibid/dep',
- url = 'https://git.squi.bid/dep',
- pin = true,
- -- branch = 'dev'
- },
-
- -- colorschemes -------------------------------------------------------------
- { 'mellow-theme/mellow.nvim',
- requires = 'nvim-treesitter/nvim-treesitter'
- },
-
- -- ui -----------------------------------------------------------------------
- { 'lukas-reineke/indent-blankline.nvim' }, -- indentation indicators
- { 'folke/which-key.nvim' }, -- key map help
- { 'rcarriga/nvim-notify' }, -- notifications
- { 'tjdevries/express_line.nvim', -- status bar
- requires = 'nvim-lua/plenary.nvim'
- },
- { 'goolord/alpha-nvim' }, -- start page
- { 'dinhhuy258/sfm.nvim', -- tree view
- deps = 'dinhhuy258/sfm-git.nvim'
- },
- { 'matbme/JABS.nvim' }, -- buffer switcher
- { 'stevearc/dressing.nvim', -- nice ui selectors
- requires = 'nvim-telescope/telescope.nvim'
- },
- { 'lukas-reineke/headlines.nvim',
- requires = 'nvim-neorg/neorg'
- },
- { 'squibid/tar', -- tab bar
- url = 'https://git.squi.bid/tar'
- },
-
- -- functional plugins -------------------------------------------------------
- { 'lewis6991/gitsigns.nvim' }, -- very helpful git things
- { 'chentoast/marks.nvim' }, -- marks in gutter
- { 'vidocqh/auto-indent.nvim' }, -- better tabbing into indents
- { 'mbbill/undotree' }, -- careful this one is written in vimscript
- { 'dhruvasagar/vim-table-mode' }, -- same with this one
- { 'altermo/ultimate-autopair.nvim', -- autopairs
- branch = 'v0.6'
- },
- { 'numToStr/Comment.nvim' },
- { 'ahmedkhalf/project.nvim' }, -- cd into root of project
- { 'mrjones2014/smart-splits.nvim'}, -- buffer resizing
- { 'ThePrimeagen/harpoon', -- super duper fast navigation through files
- branch = 'harpoon2',
- requires = 'nvim-lua/plenary.nvim'
- },
-
- -- note taking --------------------------------------------------------------
- { 'nvim-neorg/neorg',
- branch = '*',
- requires = {
- 'nvim-lua/plenary.nvim',
- 'nvim-treesitter/nvim-treesitter',
- 'folke/zen-mode.nvim',
- { 'vhyrro/luarocks.nvim',
- config = function()
- -- NOTE: you need the lua.h header file for lua version 5.1 and
- -- luarocks on void linux run: xbps-install luarocks lua51-devel
-
- local output = ""
- local function cbstd(_, data, _)
- data = table.concat(data)
- data = data:gsub("\r", "\n")
- output = output..data
- end
- -- actually start the build here
- vim.fn.jobstart({ "nvim", "-l", "build.lua" }, {
- on_stdout = cbstd,
- on_stderr = cbstd,
- on_exit = function()
- -- return build status as a notification
- vim.notify(output, vim.log.levels.INFO, { title = misc.appid })
- end
- })
- end
- }
- },
- deps = { 'nvim-neorg/neorg-telescope',
- requires = 'nvim-telescope/telescope.nvim'
- }
- },
-
- { 'jbyuki/venn.nvim' },
-
- -- fzf ----------------------------------------------------------------------
- { 'nvim-telescope/telescope.nvim',
- requires = 'nvim-lua/plenary.nvim',
- deps = {
- 'nvim-telescope/telescope-file-browser.nvim',
- 'nvim-telescope/telescope-symbols.nvim',
- 'axieax/urlview.nvim'
- }
- },
- { 'nvim-telescope/telescope-fzf-native.nvim',
- config = function()
- vim.cmd('make')
- end,
- requires = 'nvim-telescope/telescope.nvim'
- },
-
- -- treesitter + colorizing --------------------------------------------------
- { 'nvim-treesitter/nvim-treesitter',
- deps = {
- 'Wansmer/treesj',
- 'nvim-treesitter/nvim-treesitter-context'
- }
- },
- { 'NvChad/nvim-colorizer.lua' },
- { 'folke/todo-comments.nvim',
- requires = 'nvim-lua/plenary.nvim'
- },
-
- -- cmp ----------------------------------------------------------------------
- { 'hrsh7th/nvim-cmp',
- deps = {
- 'lukas-reineke/cmp-under-comparator', -- better results
- 'hrsh7th/cmp-buffer', -- buffers
- 'FelipeLema/cmp-async-path', -- path
- 'hrsh7th/cmp-nvim-lsp', -- lsp
- 'hrsh7th/cmp-nvim-lua', -- nvim lua api
- 'hrsh7th/cmp-nvim-lsp-signature-help', -- completion information
- { 'L3MON4D3/cmp-luasnip-choice', -- luasnip
- requires = 'L3MON4D3/LuaSnip'
- }
- },
- },
-
- -- snippets -----------------------------------------------------------------
- { 'L3MON4D3/LuaSnip',
- deps = 'rafamadriz/friendly-snippets',
- config = function()
- vim.cmd('make install_jsregexp')
- end
- },
-
- -- lsp ----------------------------------------------------------------------
- { 'neovim/nvim-lspconfig' }, -- setup lsp
- { 'j-hui/fidget.nvim', -- shows lsp progress
- branch = 'legacy'
- },
-
- { 'dnlhc/glance.nvim' }, -- diagnostic info at a glance
- { 'aznhe21/actions-preview.nvim', -- codeactions
- requires = 'nvim-telescope/telescope.nvim'
- },
-
- { 'danymat/neogen', -- generate lsp annotations
- requires = 'nvim-treesitter/nvim-treesitter'
- },
-
- { 'whynothugo/lsp_lines.nvim',
- url = 'https://git.sr.ht/~whynothugo/lsp_lines.nvim'
- },
-
- -- mason --------------------------------------------------------------------
- { 'williamboman/mason.nvim',
- deps = {
- 'WhoIsSethDaniel/mason-tool-installer.nvim',
- 'williamboman/mason-lspconfig.nvim'
- }
- }
-}
diff --git a/lua/conf/plugins/biscuit.lua b/lua/conf/plugins/biscuit.lua
new file mode 100644
index 0000000..d5a1067
--- /dev/null
+++ b/lua/conf/plugins/biscuit.lua
@@ -0,0 +1 @@
+return { 'Biscuit-Theme/nvim' }
diff --git a/lua/conf/plugins/cmp.lua b/lua/conf/plugins/cmp.lua
new file mode 100644
index 0000000..5dbb6ed
--- /dev/null
+++ b/lua/conf/plugins/cmp.lua
@@ -0,0 +1,170 @@
+local function has_words_before()
+ unpack = unpack or table.unpack
+ local line, col = unpack(vim.api.nvim_win_get_cursor(0))
+ return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)
+ [1]:sub(col, col):match("%s") == nil
+end
+
+return { 'hrsh7th/nvim-cmp',
+ requires = {
+ 'danymat/neogen',
+ 'nvim-treesitter/nvim-treesitter',
+ 'lukas-reineke/cmp-under-comparator' -- better results
+ },
+
+ -- suppliers for completions (they require nvim-cmp to be loaded before they are)
+ deps = {
+ 'hrsh7th/cmp-buffer', -- buffers
+ 'FelipeLema/cmp-async-path', -- path
+ 'hrsh7th/cmp-nvim-lsp', -- lsp
+ 'hrsh7th/cmp-nvim-lsp-signature-help', -- completion information
+ { 'L3MON4D3/cmp-luasnip-choice', -- luasnip
+ requires = 'L3MON4D3/LuaSnip'
+ }
+ },
+
+ function()
+ local cmp = require('cmp')
+ local luasnip = require('luasnip')
+ local neogen = require('neogen')
+
+ cmp.setup {
+ -- disable when in comments
+ enabled = function()
+ local context = require('cmp.config.context')
+ if vim.api.nvim_get_mode().mode == 'c' then
+ return true
+ else
+ return not context.in_treesitter_capture("comment")
+ and not context.in_syntax_group("Comment")
+ end
+ end,
+
+ -- completion sources
+ sources = cmp.config.sources {
+ { name = 'nvim_lsp', priority = 999 },
+ { name = 'luasnip_choice', priority = 750 },
+ { name = 'buffer', max_item_count = 3 },
+ { name = 'async_path', max_item_count = 5 },
+ { name = 'neorg' },
+ { name = 'nvim_lsp_signature_help' }
+ },
+
+ -- how to sort results
+ sorting = {
+ comparators = {
+ cmp.config.compare.offset,
+ cmp.config.compare.exact,
+ cmp.config.compare.score,
+ require('cmp-under-comparator').under,
+ cmp.config.compare.kind,
+ cmp.config.compare.sort_text,
+ cmp.config.compare.length,
+ cmp.config.compare.order,
+ }
+ },
+
+ -- appearance of window
+ window = {
+ completion = {
+ scrollbar = false,
+ border = 'solid',
+ winhighlight = "Normal:WinBarNC,FloatBorder:WinBarNC,Search:WinBarNC",
+ },
+ documentation = {
+ border = 'solid',
+ winhighlight = "Normal:WinBarNC,FloatBorder:WinBarNC,Search:WinBarNC",
+ }
+ },
+
+ -- position of window
+ view = {
+ entries = {
+ name = 'custom',
+ selection_order = 'near_cursor'
+ }
+ },
+
+ -- formatting of content
+ formatting = {
+ fields = { 'menu', 'abbr', 'kind' },
+ format = function(entry, item)
+ local menu_icon = {
+ nvim_lsp = 'λ',
+ nvim_lua = 'v',
+ calc = '+',
+ luasnip = '%',
+ buffer = '@',
+ path = '#'
+ }
+
+ item.menu = menu_icon[entry.source.name]
+ return item
+ end
+ },
+
+ experimental = {
+ ghost_text = true
+ },
+
+ -- snippet integration
+ snippet = {
+ expand = function(args)
+ luasnip.lsp_expand(args.body)
+ end
+ },
+
+ -- mappings
+ mapping = cmp.mapping.preset.insert {
+ [""] = cmp.mapping(function(fallback)
+ if #cmp.get_entries() == 1 then
+ cmp.confirm({ select = true })
+ elseif cmp.visible() then
+ cmp.select_next_item()
+ elseif luasnip.expand_or_locally_jumpable() then
+ luasnip.expand_or_jump()
+ elseif has_words_before() then
+ cmp.complete()
+ if #cmp.get_entries() == 1 then
+ cmp.confirm({ select = true })
+ end
+ elseif neogen.jumpable() then
+ neogen.jump_next()
+ else
+ fallback()
+ end
+ end, { "i", "s" }),
+
+ [""] = cmp.mapping(function(fallback)
+ if cmp.visible() then
+ cmp.select_prev_item()
+ elseif luasnip.jumpable(-1) then
+ luasnip.jump(-1)
+ elseif neogen.jumpable(-1) then
+ neogen.jump_prev()
+ else
+ fallback()
+ end
+ end, { "i", "s" }),
+
+ [''] = cmp.mapping {
+ i = function(fallback)
+ if cmp.visible() and cmp.get_active_entry() then
+ cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false })
+ else
+ fallback()
+ end
+ end,
+ s = cmp.mapping.confirm({ select = true }),
+ c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace,
+ select = true }),
+ },
+
+ [""] = cmp.mapping.scroll_docs(-4),
+ [""] = cmp.mapping.scroll_docs(4),
+ [''] = cmp.mapping.close(),
+ [""] = cmp.mapping.abort()
+ }
+ }
+ end
+}
diff --git a/lua/conf/plugins/comment.lua b/lua/conf/plugins/comment.lua
new file mode 100644
index 0000000..9a6373d
--- /dev/null
+++ b/lua/conf/plugins/comment.lua
@@ -0,0 +1,7 @@
+return { 'numToStr/Comment.nvim',
+ function()
+ require('Comment').setup {
+ ignore = '^$'
+ }
+ end
+}
diff --git a/lua/conf/plugins/dressing.lua b/lua/conf/plugins/dressing.lua
new file mode 100644
index 0000000..64f9723
--- /dev/null
+++ b/lua/conf/plugins/dressing.lua
@@ -0,0 +1,21 @@
+local branch = nil
+if vim.version().minor == 7 then
+ branch = 'nvim-0.7'
+elseif vim.version().minor == 5 then
+ branch = 'nvim-0.5'
+end
+
+return { 'stevearc/dressing.nvim',
+ disable = vim.version().minor < 5,
+ branch = branch,
+ requires = 'nvim-telescope/telescope.nvim',
+ function()
+ require('dressing').setup {
+ input = {
+ title_pos = "center",
+ border = 'solid',
+ relative = "win"
+ }
+ }
+ end
+}
diff --git a/lua/conf/plugins/fidget.lua b/lua/conf/plugins/fidget.lua
new file mode 100644
index 0000000..e36488e
--- /dev/null
+++ b/lua/conf/plugins/fidget.lua
@@ -0,0 +1,34 @@
+return { 'j-hui/fidget.nvim',
+ disable = vim.version().minor < 9,
+ function()
+ local notification_defaults = require("fidget.notification").default_config
+ notification_defaults["icon"] = ""
+
+ require('fidget').setup {
+ progress = {
+ display = {
+ progress_icon = {
+ pattern = "line",
+ period = 1
+ },
+ done_icon = ":)",
+ }
+ },
+ notification = {
+ override_vim_notify = true,
+ configs = {
+ default = notification_defaults,
+ },
+ view = {
+ icon_separator = " ",
+ group_separator = "---",
+ group_separator_hl = "Comment",
+ },
+ window = {
+ zindex = 44,
+ relative = "win"
+ }
+ }
+ }
+ end
+}
diff --git a/lua/conf/plugins/gitsigns.lua b/lua/conf/plugins/gitsigns.lua
new file mode 100644
index 0000000..f168b93
--- /dev/null
+++ b/lua/conf/plugins/gitsigns.lua
@@ -0,0 +1,78 @@
+local misc = require('core.misc')
+local map = misc.map
+
+return { 'lewis6991/gitsigns.nvim',
+ disable = vim.version().minor < 9,
+ function()
+ local gs = require("gitsigns")
+
+ gs.setup {
+ signs = {
+ add = { text = '│' },
+ change = { text = '│' },
+ delete = { text = '-' },
+ topdelete = { text = '‾' },
+ changedelete = { text = '~' },
+ untracked = { text = '┆' }
+ },
+
+ signcolumn = true,
+ numhl = false,
+ linehl = false,
+ word_diff = false,
+
+ watch_gitdir = {
+ interval = 1000,
+ follow_files = true
+ },
+
+ attach_to_untracked = true,
+ current_line_blame_formatter = ', - ',
+
+ preview_config = { border = 'solid' },
+
+ on_attach = function(bufnr)
+ local opts = { buffer = bufnr }
+
+ -- Navigation
+ map('n', ']c', function()
+ if vim.wo.diff then
+ return ']c'
+ end
+ vim.schedule(function() gs.next_hunk() end)
+ return ''
+ end, { expr = true, buffer = bufnr })
+
+ map('n', '[c', function()
+ if vim.wo.diff then
+ return '[c'
+ end
+ vim.schedule(function() gs.prev_hunk() end)
+ return ''
+ end, { expr = true, buffer = bufnr })
+
+ -- Actions
+ map('n', 'hs', gs.stage_hunk, opts)
+ map('n', 'hr', gs.reset_hunk, opts)
+ map('v', 'hs', function()
+ gs.stage_hunk { vim.fn.line('.'), vim.fn.line('v') }
+ end, opts)
+ map('v', 'hr', function()
+ gs.reset_hunk { vim.fn.line('.'), vim.fn.line('v') }
+ end, opts)
+ map('n', 'hS', gs.stage_buffer, opts)
+ map('n', 'hu', gs.undo_stage_hunk, opts)
+ map('n', 'hR', gs.reset_buffer, opts)
+ map('n', 'hp', gs.preview_hunk, opts)
+ map('n', 'hb', function() gs.blame_line { full=true } end, opts)
+ map('n', 'tb', gs.toggle_current_line_blame, opts)
+ map('n', 'hd', gs.diffthis, opts)
+ map('n', 'hD', function() gs.diffthis('~') end, opts)
+ map('n', 'td', gs.toggle_deleted, opts)
+
+ -- Text object
+ map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', opts)
+ end
+ }
+ end
+}
diff --git a/lua/conf/plugins/glance.lua b/lua/conf/plugins/glance.lua
new file mode 100644
index 0000000..c5a4d41
--- /dev/null
+++ b/lua/conf/plugins/glance.lua
@@ -0,0 +1,44 @@
+local misc = require('core.misc')
+local map = misc.map
+
+return { 'dnlhc/glance.nvim',
+ disable = vim.version().minor < 7,
+ function()
+ require('glance').setup {
+ border = {
+ enable = true,
+ top_char = '',
+ bottom_char = '─',
+ },
+ folds = {
+ fold_closed = '+',
+ fold_open = '-',
+ folded = true
+ },
+ theme = {
+ enable = false
+ },
+ hooks = {
+ before_open = function(results, open, jump, method)
+ local uri = vim.uri_from_bufnr(0)
+ if #results == 1 then
+ local target_uri = results[1].uri or results[1].targetUri
+
+ if target_uri == uri then
+ jump()
+ misc.timeout_highlight()
+ return
+ end
+ end
+
+ open()
+ end
+ }
+ }
+
+ map('n', 'gd', 'Glance definitions')
+ map('n', 'gr', 'Glance references')
+ map('n', 'gy', 'Glance type_definitions')
+ map('n', 'gi', 'Glance implementations')
+ end
+}
diff --git a/lua/conf/plugins/harpoon.lua b/lua/conf/plugins/harpoon.lua
new file mode 100644
index 0000000..cb2edca
--- /dev/null
+++ b/lua/conf/plugins/harpoon.lua
@@ -0,0 +1,31 @@
+local misc = require('core.misc')
+local map = misc.map
+
+return { 'ThePrimeagen/harpoon',
+ disable = vim.version().minor < 8,
+ branch = 'harpoon2',
+ requires = 'nvim-lua/plenary.nvim',
+ function()
+ local harpoon = require("harpoon")
+
+ harpoon:setup()
+
+ map("n", "a", function()
+ harpoon:list():add()
+ vim.notify("added "..vim.fn.expand("%:t").." to quickmarks", vim.log.levels.INFO, {
+ title = misc.appid,
+ })
+ end, { desc = "add current file to quickmarks" })
+
+ map("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
+
+ map("n", "", function() harpoon:list():select(1) end)
+ map("n", "", function() harpoon:list():select(2) end)
+ map("n", "", function() harpoon:list():select(3) end)
+ map("n", "", function() harpoon:list():select(4) end)
+
+ -- Toggle previous & next buffers stored within Harpoon list
+ map("n", "", function() harpoon:list():prev() end)
+ map("n", "", function() harpoon:list():next() end)
+ end
+}
diff --git a/lua/conf/plugins/headlines.lua b/lua/conf/plugins/headlines.lua
new file mode 100644
index 0000000..c932d72
--- /dev/null
+++ b/lua/conf/plugins/headlines.lua
@@ -0,0 +1,28 @@
+return { 'lukas-reineke/headlines.nvim',
+ requires = 'nvim-treesitter/nvim-treesitter',
+ function()
+ require('headlines').setup {
+ norg = {
+ headline_highlights = {
+ "@neorg.headings.1.title",
+ "@neorg.headings.2.title",
+ "@neorg.headings.3.title",
+ "@neorg.headings.4.title",
+ "@neorg.headings.5.title",
+ "@neorg.headings.6.title"
+ },
+ bullets = { "", "", "", "" },
+ },
+ markdown = {
+ headline_highlights = {
+ "@neorg.headings.1.title",
+ "@neorg.headings.2.title",
+ "@neorg.headings.3.title",
+ "@neorg.headings.4.title",
+ "@neorg.headings.5.title",
+ "@neorg.headings.6.title"
+ }
+ }
+ }
+ end
+}
diff --git a/lua/conf/plugins/incline.lua b/lua/conf/plugins/incline.lua
new file mode 100644
index 0000000..03b4284
--- /dev/null
+++ b/lua/conf/plugins/incline.lua
@@ -0,0 +1,12 @@
+return { 'b0o/incline.nvim',
+ function()
+ vim.cmd('set laststatus=3')
+
+ require('incline').setup {
+ hide = {
+ focused_win = true,
+ cursorline = true
+ }
+ }
+ end
+}
diff --git a/lua/conf/plugins/jdtls.lua b/lua/conf/plugins/jdtls.lua
new file mode 100644
index 0000000..e9808d6
--- /dev/null
+++ b/lua/conf/plugins/jdtls.lua
@@ -0,0 +1,3 @@
+return { 'mfussenegger/nvim-jdtls',
+ disable = vim.version().minor < 6
+}
diff --git a/lua/conf/plugins/lsp_lines.lua b/lua/conf/plugins/lsp_lines.lua
new file mode 100644
index 0000000..b257de5
--- /dev/null
+++ b/lua/conf/plugins/lsp_lines.lua
@@ -0,0 +1,14 @@
+return { 'whynothugo/lsp_lines.nvim',
+ url = 'https://git.sr.ht/~whynothugo/lsp_lines.nvim',
+ requires = 'neovim/nvim-lspconfig',
+ function()
+ require('lsp_lines').setup()
+
+ vim.diagnostic.config {
+ virtual_lines = {
+ highlight_whole_line = false,
+ only_current_line = true
+ }
+ }
+ end
+}
diff --git a/lua/conf/plugins/lspconfig.lua b/lua/conf/plugins/lspconfig.lua
new file mode 100644
index 0000000..3dce638
--- /dev/null
+++ b/lua/conf/plugins/lspconfig.lua
@@ -0,0 +1,18 @@
+return { 'neovim/nvim-lspconfig',
+ disable = vim.version().minor < 8,
+ function()
+ vim.diagnostic.config {
+ virtual_text = false,
+ signs = true,
+ update_in_insert = false,
+ underline = true,
+ severity_sort = true
+ }
+
+ vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
+ vim.lsp.handlers.hover, { border = 'solid' })
+
+ vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
+ vim.lsp.handlers.signature_help, { border = 'solid' })
+ end
+}
diff --git a/lua/conf/plugins/luasnip.lua b/lua/conf/plugins/luasnip.lua
new file mode 100644
index 0000000..26b293b
--- /dev/null
+++ b/lua/conf/plugins/luasnip.lua
@@ -0,0 +1,52 @@
+local misc = require('core.misc')
+local map = misc.map
+
+return { 'L3MON4D3/LuaSnip',
+ branch = 'v2.3.0',
+ disable = vim.version().minor < 7,
+ config = function()
+ vim.cmd('make install_jsregexp')
+ end,
+ function()
+ local luasnip = require('luasnip')
+ local types = require("luasnip.util.types")
+
+ luasnip.config.set_config {
+ history = true, -- return back into snippet
+ updateevents = { "TextChanged", "TextChangedI" }, -- update on text insert
+ ext_opts = {
+ [types.choiceNode] = {
+ active = {
+ virt_text = {{ "●", "@boolean" }}
+ }
+ },
+ [types.insertNode] = {
+ active = {
+ virt_text = {{ "●", "@constant" }}
+ }
+ },
+ },
+ }
+
+ map({"i", "s"}, { "", "" }, function()
+ if luasnip.choice_active() then
+ luasnip.change_choice(1)
+ end
+ end)
+
+ map({"i", "s"}, "", function()
+ if luasnip.expandable(-1) then
+ luasnip.expand(-1)
+ end
+ end)
+
+ -- load all snippets from snippet directory
+ for _, file in ipairs(vim.api.nvim_get_runtime_file("lua/snippets/*.lua", true)) do
+ local fn = file:gsub('^.*/', ''):gsub('%.lua$', '')
+ local ret = misc.include('snippets.'..fn)
+ if type(ret) ~= "boolean" then
+ luasnip.add_snippets(fn, ret, { key = fn })
+ end
+ end
+ end
+}
diff --git a/lua/conf/plugins/mason-lspconfig.lua b/lua/conf/plugins/mason-lspconfig.lua
new file mode 100644
index 0000000..edeaf93
--- /dev/null
+++ b/lua/conf/plugins/mason-lspconfig.lua
@@ -0,0 +1,369 @@
+local misc = require('core.misc')
+local map, auto, augroup = misc.map, misc.auto, misc.augroup
+
+return { 'williamboman/mason-lspconfig.nvim',
+ requires = {
+ 'williamboman/mason.nvim',
+ 'mfussenegger/nvim-jdtls',
+ 'neovim/nvim-lspconfig'
+ },
+ function()
+ local util = require('lspconfig.util')
+
+ -- configure lsp when attached
+ local function lsp_attach(client, bufnr)
+ -- helper function(s)
+ local function set_lsp_sign(name, text)
+ vim.fn.sign_define(name, { text = text, texthl = name })
+ end
+
+ set_lsp_sign("DiagnosticSignError", "x")
+ set_lsp_sign("DiagnosticSignWarn" , "!")
+ set_lsp_sign("DiagnosticSignInfo" , "i")
+ set_lsp_sign("DiagnosticSignHint" , "h")
+
+ local opts = { buffer = bufnr }
+ -- LSP actions
+ map('n', 'K', vim.lsp.buf.hover, opts)
+ map('n', 'gD', vim.lsp.buf.definition, opts)
+ -- map('n', 'gD', 'lua vim.lsp.buf.declaration()