diff options
Diffstat (limited to '')
-rw-r--r-- | after/ftplugin/gitcommit.lua | 1 | ||||
-rw-r--r-- | after/ftplugin/java.lua | 4 | ||||
-rw-r--r-- | after/plugin/actionpreview.lua | 1 | ||||
-rw-r--r-- | after/plugin/cmp.lua | 61 | ||||
-rw-r--r-- | after/plugin/dressing.lua | 16 | ||||
-rw-r--r-- | after/plugin/glance.lua | 1 | ||||
-rw-r--r-- | after/plugin/headlines.lua | 17 | ||||
-rw-r--r-- | after/plugin/hypersonic.lua | 8 | ||||
-rw-r--r-- | after/plugin/indent-blankline.lua | 7 | ||||
-rw-r--r-- | after/plugin/luasnip-choice.lua | 6 | ||||
-rw-r--r-- | after/plugin/notify.lua | 8 | ||||
-rw-r--r-- | after/plugin/startpage.lua | 2 | ||||
-rw-r--r-- | after/plugin/statusline.lua | 6 | ||||
-rw-r--r-- | after/plugin/tabline.lua | 11 | ||||
-rw-r--r-- | after/plugin/telescope.lua | 53 |
15 files changed, 110 insertions, 92 deletions
diff --git a/after/ftplugin/gitcommit.lua b/after/ftplugin/gitcommit.lua index 8207d63..dece15e 100644 --- a/after/ftplugin/gitcommit.lua +++ b/after/ftplugin/gitcommit.lua @@ -1,2 +1 @@ -vim.cmd('set spell!') vim.cmd('startinsert | 1') diff --git a/after/ftplugin/java.lua b/after/ftplugin/java.lua index 53eb334..2c3db93 100644 --- a/after/ftplugin/java.lua +++ b/after/ftplugin/java.lua @@ -1,4 +1,4 @@ --- IMPORTANT: Make sure you're $JAVA_HOME is correct (prob should be 17 or higher) +-- 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 = {} @@ -16,7 +16,7 @@ local features = { -- change this to `true` if you have `nvim-dap`, -- `java-test` and `java-debug-adapter` installed - debugger = false, + debugger = true, } local function get_jdtls_paths() diff --git a/after/plugin/actionpreview.lua b/after/plugin/actionpreview.lua index 21d4ea4..750e06b 100644 --- a/after/plugin/actionpreview.lua +++ b/after/plugin/actionpreview.lua @@ -12,6 +12,5 @@ actions.setup { preview = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; }, layout_strategy = 'cursor', - winblend = 10, } } diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua index d9a83d2..0e8de6b 100644 --- a/after/plugin/cmp.lua +++ b/after/plugin/cmp.lua @@ -3,34 +3,6 @@ if not status_ok then return end -local lspicons = { - Text = 'Tx', - Snippet = '<>', - Method = '{}', - Function = '{}', - Constructor = '{}', - Field = '""', - Variable = 'i=', - Class = '{}', - Interface = '.h', - Module = '{}', - Property = '@p', - Unit = ' ', - Value = 'x=', - Enum = 'E#', - Keyword = '$1', - Color = ' ', - File = '#`', - Reference = ' ', - Folder = '[/', - EnumMember = ' ', - Constant = 'c=', - Struct = ' ', - Event = ' ', - Operator = '%*', - TypeParameter = ' ', -} - local has_words_before = function() unpack = unpack or table.unpack local line, col = unpack(a.nvim_win_get_cursor(0)) @@ -38,11 +10,9 @@ local has_words_before = function() [1]:sub(col, col):match("%s") == nil end --- insert '(' after completing a function -cmp.event:on( - 'confirm_done', - require('nvim-autopairs.completion.cmp').on_confirm_done() -) +-- insert '()' after completing a function +cmp.event:on('confirm_done', + require('nvim-autopairs.completion.cmp').on_confirm_done()) local luasnip = require('luasnip') local neogen = require('neogen') @@ -57,7 +27,7 @@ cmp.setup { sources = cmp.config.sources({ { name = 'nvim_lsp', keyword_length = 3 }, - { name = 'luasnip', keyword_length = 3 }, + { name = 'luasnip_choice' }, { name = 'async_path' }, { name = 'buffer', keyword_length = 3, max_item_count = 7 }, { name = 'calc' }, @@ -80,12 +50,17 @@ cmp.setup { -- mappings ----------------------------------------------------------------- mapping = cmp.mapping.preset.insert({ ["<Tab>"] = cmp.mapping(function(fallback) - if cmp.visible() then + 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 @@ -103,7 +78,7 @@ cmp.setup { fallback() end end, { "i", "s" }), - ['<CR>'] = cmp.mapping({ + ['<CR>'] = cmp.mapping { i = function(fallback) if cmp.visible() and cmp.get_active_entry() then cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }) @@ -112,9 +87,13 @@ cmp.setup { end end, s = cmp.mapping.confirm({ select = true }), - c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), - }), + c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, + select = true }), + }, + ["<C-u>"] = cmp.mapping.scroll_docs(-4), + ["<C-d>"] = cmp.mapping.scroll_docs(4), ['<ESC>'] = cmp.mapping.close(), + ["<C-e>"] = cmp.mapping.abort(), }), sorting = { @@ -122,12 +101,12 @@ cmp.setup { cmp.config.compare.offset, cmp.config.compare.exact, cmp.config.compare.score, - require "cmp-under-comparator".under, + 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' @@ -135,7 +114,7 @@ cmp.setup { return true else return not context.in_treesitter_capture("comment") - and not context.in_syntax_group("Comment") + and not context.in_syntax_group("Comment") end end } diff --git a/after/plugin/dressing.lua b/after/plugin/dressing.lua new file mode 100644 index 0000000..6beb0b7 --- /dev/null +++ b/after/plugin/dressing.lua @@ -0,0 +1,16 @@ +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/glance.lua b/after/plugin/glance.lua index 08f90d1..230e04c 100644 --- a/after/plugin/glance.lua +++ b/after/plugin/glance.lua @@ -3,7 +3,6 @@ if not status_ok then return end -local actions = glance.actions glance.setup { detached = function(winid) return vim.api.nvim_win_get_width(winid) < 100 diff --git a/after/plugin/headlines.lua b/after/plugin/headlines.lua new file mode 100644 index 0000000..5ecacda --- /dev/null +++ b/after/plugin/headlines.lua @@ -0,0 +1,17 @@ +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" + }, + }, +} diff --git a/after/plugin/hypersonic.lua b/after/plugin/hypersonic.lua deleted file mode 100644 index 2954d92..0000000 --- a/after/plugin/hypersonic.lua +++ /dev/null @@ -1,8 +0,0 @@ -local status_ok, hypersonic = pcall(require, "hypersonic") -if not status_ok then - return -end - -hypersonic.setup { - border = 'shadow' -} diff --git a/after/plugin/indent-blankline.lua b/after/plugin/indent-blankline.lua index 02f2428..ae187fb 100644 --- a/after/plugin/indent-blankline.lua +++ b/after/plugin/indent-blankline.lua @@ -4,7 +4,12 @@ if not status_ok then end ibl.setup { + indent = { + char = '▏', + }, scope = { - enabled = false, + enabled = true, + show_start = false, + show_end = false }, } diff --git a/after/plugin/luasnip-choice.lua b/after/plugin/luasnip-choice.lua new file mode 100644 index 0000000..5207721 --- /dev/null +++ b/after/plugin/luasnip-choice.lua @@ -0,0 +1,6 @@ +local status_ok, lschoice = pcall(require, "cmp_luasnip_choice") +if not status_ok then + return +end + +lschoice.setup {} diff --git a/after/plugin/notify.lua b/after/plugin/notify.lua index 36d7885..5d27a7c 100644 --- a/after/plugin/notify.lua +++ b/after/plugin/notify.lua @@ -17,16 +17,16 @@ notify.setup { 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" }, + { ' '..record.title[1]..' ', 'Notify'..record.level..'Title' } }, - title_pos = "center", - border = "single", + title_pos = 'center', + border = 'single' }) end, render = function(bufnr, notif) - notif.message[1] = string.format("%s", notif.message[1]) vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, notif.message) end, } diff --git a/after/plugin/startpage.lua b/after/plugin/startpage.lua index 6261b3f..afd93dc 100644 --- a/after/plugin/startpage.lua +++ b/after/plugin/startpage.lua @@ -70,7 +70,7 @@ alpha.setup { button('f', '? Find files', '<cmd>Telescope find_files<CR>'), button('r', '↺ Recent files', '<cmd>Telescope oldfiles <CR>'), button('n', '▣ Neorg workspace', '<cmd>Telescope neorg switch_workspace<CR>'), - button('m', '≡ Menu', '<cmd>ConfigMenu<CR>'), + button('m', '≡ Menu', '<cmd>lua require("core.conf").configmenu()<CR>'), button('q', '✖ Quit', '<cmd>wqa<CR>'), } }, { type = 'text', val = footer, opts = { diff --git a/after/plugin/statusline.lua b/after/plugin/statusline.lua index 9e578a7..e30c946 100644 --- a/after/plugin/statusline.lua +++ b/after/plugin/statusline.lua @@ -7,13 +7,13 @@ el.reset_windows() local builtin = require("el.builtin") local sections = require("el.sections") -local c = require "components" +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"}, + bg = { ["StatusLine"] = "bg" }, + fg = { [fg] = "fg" }, bold = b, }) end diff --git a/after/plugin/tabline.lua b/after/plugin/tabline.lua new file mode 100644 index 0000000..4b9dcfa --- /dev/null +++ b/after/plugin/tabline.lua @@ -0,0 +1,11 @@ +local status_ok, tabline = pcall(require, "tar") +if not status_ok then + return +end + +tabline.setup { + layout = { + { type = 'taglist' }, + }, + seperator = '|', +} diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua index 519ecbd..601a800 100644 --- a/after/plugin/telescope.lua +++ b/after/plugin/telescope.lua @@ -9,16 +9,28 @@ local function telescopew() if vim.o.columns <= 80 then return vim.o.columns else - return 80 + return 0.8 end end telescope.setup { defaults = { borderchars = { - prompt = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; - results = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; - preview = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; + 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 @@ -30,7 +42,7 @@ telescope.setup { 'jpe', 'jpeg', 'webp', - 'gif', + 'gif' } local split_path = vim.split(filepath:lower(), '.', { plain=true }) local extension = split_path[#split_path] @@ -38,39 +50,22 @@ telescope.setup { end if is_image(filepath) then local term = vim.api.nvim_open_term(bufnr, {}) - local function send_output(_, data, _ ) + 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', - (telescopew() - 10)..'x25', - '--clear', - filepath + 'chafa', '-C', 'on', '--animate', 'off', '-s', + (telescopew() - 10)..'x20', '--clear', filepath }, { on_stdout = send_output, stdout_buffered = true, pty = true }) - a.nvim_set_option_value("number", false, {buf = bufnr}) + a.nvim_set_option_value("number", false, { buf = bufnr }) else - require("telescope.previewers.utils").set_preview_message(bufnr, opts.winid, "File cannot be previewed") + require("telescope.previewers.utils").set_preview_message(bufnr, + opts.winid, "File cannot be previewed") end end }, - - winblend = 0, - -- 'horizontal', 'vertical', 'bottom_pane', or 'cursor' - layout_strategy = 'vertical', - sorting_strategy = 'ascending', - layout_config = { - vertical = { - width = telescopew(), - prompt_position = "top", - } - }, mappings = { i = { ["<esc>"] = actions.close, @@ -90,8 +85,8 @@ telescope.setup { } } telescope.load_extension('file_browser') -telescope.load_extension('ui-select') telescope.load_extension('projects') +telescope.load_extension('fzf') a.nvim_create_autocmd('User', { pattern = 'TelescopePreviewerLoaded', |