diff --git a/init.lua b/init.lua index 96f6900..3437091 100644 --- a/init.lua +++ b/init.lua @@ -178,7 +178,6 @@ vim.api.nvim_create_autocmd('TextYankPost', { pattern = '*', }) -local fb_actions = require "telescope".extensions.file_browser.actions -- [[ Configure Telescope ]] require('telescope').setup { defaults = { @@ -195,15 +194,14 @@ require('telescope').setup { } }, extensions = { - file_browser = { - initial_mode = "normal", - theme = "ivy", - hijack_netrw = true - }, + -- file_browser = { + -- initial_mode = "normal", + -- theme = "ivy", + -- hijack_netrw = true + -- }, }, } -require("telescope").load_extension("file_browser") -- Enable telescope fzf native, if installed pcall(require('telescope').load_extension, 'fzf') @@ -235,7 +233,7 @@ require('nvim-treesitter.configs').setup { auto_install = false, highlight = { enable = true }, - indent = { enable = true }, + -- indent = { enable = true }, incremental_selection = { enable = true, keymaps = { diff --git a/lua/custom/plugins/bufferline.lua b/lua/custom/plugins/bufferline.lua index 518be38..a0b6efe 100644 --- a/lua/custom/plugins/bufferline.lua +++ b/lua/custom/plugins/bufferline.lua @@ -27,6 +27,7 @@ return { else options = { show_buffer_icons = false, + diagnostics = "nvim_lsp", } end diff --git a/lua/custom/plugins/cmp.lua b/lua/custom/plugins/cmp.lua index e9ad411..3341898 100644 --- a/lua/custom/plugins/cmp.lua +++ b/lua/custom/plugins/cmp.lua @@ -122,25 +122,24 @@ return { }, sources = { { name = 'nvim_lsp' }, - { name = "neorg" }, + { name = "orgmode" }, { name = 'luasnip' }, - { name = 'buffer' }, { name = 'path' }, + { name = 'buffer' }, }, formatting = { - fields = { "menu", "abbr", "kind" }, - format = function(entry, item) - local menu_icon = { - nvim_lsp = " ", - luasnip = " ", - buffer = 'Ω ', - path = "", - } + fields = { "abbr", "menu", "kind" }, + format = require('lspkind').cmp_format({ + mode = 'symbol_text', -- show only symbol annotations + maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) + -- can also be a function to dynamically calculate max width such as + -- maxwidth = function() return math.floor(0.45 * vim.o.columns) end, + ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) + show_labelDetails = true, -- show labelDetails in menu. Disabled by default - item.menu = menu_icon[entry.source.name] - item.kind = " " .. item.kind - return item - end, + -- The function below will be called before any actual modifications from lspkind + -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) + }) }, window = { completion = cmp.config.window.bordered(winhighlight), diff --git a/lua/custom/plugins/emmet.lua b/lua/custom/plugins/emmet.lua index 17138d3..5c64a91 100644 --- a/lua/custom/plugins/emmet.lua +++ b/lua/custom/plugins/emmet.lua @@ -2,7 +2,7 @@ return { "mattn/emmet-vim", config = function() local autocmd = vim.api.nvim_create_autocmd - autocmd("FileType", { pattern = { "html", "css" }, command = [[EmmetInstall]] }) + autocmd("FileType", { pattern = { "html", "css", "vue", "js" }, command = [[EmmetInstall]] }) vim.keymap.set("n", "le", function() vim.cmd(string.format("Emmet %s", vim.fn.input("Emmet: "))) diff --git a/lua/custom/plugins/file-browser.lua b/lua/custom/plugins/file-browser.lua deleted file mode 100644 index b784bba..0000000 --- a/lua/custom/plugins/file-browser.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "nvim-telescope/telescope-file-browser.nvim", - dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" } -} diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua index 0ea130a..a84272e 100644 --- a/lua/custom/plugins/lualine.lua +++ b/lua/custom/plugins/lualine.lua @@ -1,197 +1,198 @@ return { - -- "nvim-lualine/lualine.nvim", - -- config = function() - -- local c = require("darkrose.colors").get() - -- local lualine = require("lualine") - -- - -- local bg = c.bg_float_bright - -- - -- local conditions = { - -- buffer_not_empty = function() - -- return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 - -- end, - -- hide_in_width = function() - -- return vim.fn.winwidth(0) > 80 - -- end, - -- check_git_workspace = function() - -- local filepath = vim.fn.expand("%:p:h") - -- local gitdir = vim.fn.finddir(".git", filepath .. ";") - -- return gitdir and #gitdir > 0 and #gitdir < #filepath - -- end, - -- } - -- - -- -- Config - -- local config = { - -- options = { - -- -- Disable sections and component separators - -- component_separators = "", - -- section_separators = "", - -- theme = { - -- -- We are going to use lualine_c an lualine_x as the left - -- -- and right sections. Both are highlighted by c theme. - -- normal = { c = { fg = c.fg, bg = bg } }, - -- inactive = { c = { fg = c.fg, bg = bg } }, - -- }, - -- }, - -- sections = { - -- -- these are to remove the defaults - -- lualine_a = {}, - -- lualine_b = {}, - -- lualine_y = {}, - -- lualine_z = {}, - -- -- These will be filled later - -- lualine_c = {}, - -- lualine_x = {}, - -- }, - -- inactive_sections = { - -- -- these are to remove the defaults - -- lualine_a = {}, - -- lualine_b = {}, - -- lualine_y = {}, - -- lualine_z = {}, - -- lualine_c = {}, - -- lualine_x = {}, - -- }, - -- } - -- - -- -- Inserts a component in lualine_c at left section - -- local function left(component) - -- table.insert(config.sections.lualine_c, component) - -- end - -- - -- -- Inserts a component in lualine_x ot right section - -- local function right(component) - -- table.insert(config.sections.lualine_x, component) - -- end - -- - -- left({ - -- function() - -- return "▊" - -- end, - -- color = { fg = c.gray }, - -- padding = { left = 0, right = 1 }, - -- }) - -- - -- left({ - -- function() - -- return "" - -- end, - -- color = function() - -- local mode_color = { - -- n = c.red, -- Normal - -- i = c.orange, -- Insert - -- ic = c.orange, -- Completion insert - -- no = c.red, -- Operator-pending - -- c = c.dark_pink, -- Command-line - -- v = c.magenta, -- Visual - -- V = c.magenta, -- Line-wise visual - -- [""] = c.magenta, -- Block-wise visual - -- s = c.magenta, -- Select - -- S = c.magenta, -- Line-wise visual - -- [""] = c.magenta, -- Block-wise visual - -- R = c.light_pink, -- Replace - -- Rv = c.light_pink, -- Virtual replace - -- cv = c.dark_pink, -- Ex - -- r = c.red, -- Hit-enter - -- rm = c.red, -- More prompt - -- ["r?"] = c.red, -- :confirm - -- ["!"] = c.red, -- Shell command - -- t = c.red, -- Terminal - -- } - -- return { fg = mode_color[vim.fn.mode()] } - -- end, - -- padding = { right = 1 }, - -- }) - -- - -- left({ - -- "filename", - -- cond = conditions.buffer_not_empty, - -- color = { fg = c.dark_pink, gui = "bold" }, - -- }) - -- - -- left({ "location" }) - -- - -- left({ - -- function() - -- local cur = vim.fn.line(".") - -- local total = vim.fn.line("$") - -- return math.floor(cur / total * 100) .. "%%" - -- end, - -- color = { fg = c.fg, gui = "bold" }, - -- }) - -- - -- left({ - -- "diagnostics", - -- sources = { "nvim_diagnostic" }, - -- symbols = { error = " ", warn = " ", info = " ", hint = " " }, - -- diagnostics_color = { - -- error = { fg = c.error }, - -- warn = { fg = c.warning }, - -- info = { fg = c.info }, - -- hint = { fg = c.hint }, - -- }, - -- }) - -- - -- right({ - -- function() - -- if vim.api.nvim_get_vvar("hlsearch") == 1 then - -- local res = vim.fn.searchcount({ maxcount = 999, timeout = 500 }) - -- - -- if res.total > 0 then - -- return string.format("%d/%d", res.current, res.total) - -- end - -- end - -- - -- return "" - -- end, - -- }) - -- - -- right({ "filetype" }) - -- - -- right({ - -- "filesize", - -- cond = conditions.buffer_not_empty, - -- }) - -- - -- right({ - -- "o:encoding", - -- fmt = string.upper, - -- cond = conditions.hide_in_width, - -- color = { fg = c.red, gui = "bold" }, - -- }) - -- - -- right({ - -- "fileformat", - -- fmt = string.upper, - -- icons_enabled = false, - -- color = { fg = c.red, gui = "bold" }, - -- }) - -- - -- right({ - -- "branch", - -- icon = "", - -- color = { fg = c.orange, gui = "bold" }, - -- }) - -- - -- right({ - -- "diff", - -- symbols = { added = "+", modified = "~", removed = "-" }, - -- diff_color = { - -- added = { fg = c.diff.add }, - -- modified = { fg = c.diff.change }, - -- removed = { fg = c.diff.delete }, - -- }, - -- cond = conditions.hide_in_width, - -- }) - -- - -- right({ - -- function() - -- return "▊" - -- end, - -- color = { fg = c.gray }, - -- padding = { left = 1 }, - -- }) - -- - -- lualine.setup(config) - -- end, } + + +-- config = function() +-- local c = require("darkrose.colors").get() +-- local lualine = require("lualine") +-- +-- local bg = c.bg_float_bright +-- +-- local conditions = { +-- buffer_not_empty = function() +-- return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 +-- end, +-- hide_in_width = function() +-- return vim.fn.winwidth(0) > 80 +-- end, +-- check_git_workspace = function() +-- local filepath = vim.fn.expand("%:p:h") +-- local gitdir = vim.fn.finddir(".git", filepath .. ";") +-- return gitdir and #gitdir > 0 and #gitdir < #filepath +-- end, +-- } +-- +-- -- Config +-- local config = { +-- options = { +-- -- Disable sections and component separators +-- component_separators = "", +-- section_separators = "", +-- theme = { +-- -- We are going to use lualine_c an lualine_x as the left +-- -- and right sections. Both are highlighted by c theme. +-- normal = { c = { fg = c.fg, bg = bg } }, +-- inactive = { c = { fg = c.fg, bg = bg } }, +-- }, +-- }, +-- sections = { +-- -- these are to remove the defaults +-- lualine_a = {}, +-- lualine_b = {}, +-- lualine_y = {}, +-- lualine_z = {}, +-- -- These will be filled later +-- lualine_c = {}, +-- lualine_x = {}, +-- }, +-- inactive_sections = { +-- -- these are to remove the defaults +-- lualine_a = {}, +-- lualine_b = {}, +-- lualine_y = {}, +-- lualine_z = {}, +-- lualine_c = {}, +-- lualine_x = {}, +-- }, +-- } +-- +-- -- Inserts a component in lualine_c at left section +-- local function left(component) +-- table.insert(config.sections.lualine_c, component) +-- end +-- +-- -- Inserts a component in lualine_x ot right section +-- local function right(component) +-- table.insert(config.sections.lualine_x, component) +-- end +-- +-- left({ +-- function() +-- return "▊" +-- end, +-- color = { fg = c.gray }, +-- padding = { left = 0, right = 1 }, +-- }) +-- +-- left({ +-- function() +-- return "" +-- end, +-- color = function() +-- local mode_color = { +-- n = c.red, -- Normal +-- i = c.orange, -- Insert +-- ic = c.orange, -- Completion insert +-- no = c.red, -- Operator-pending +-- c = c.dark_pink, -- Command-line +-- v = c.magenta, -- Visual +-- V = c.magenta, -- Line-wise visual +-- [""] = c.magenta, -- Block-wise visual +-- s = c.magenta, -- Select +-- S = c.magenta, -- Line-wise visual +-- [""] = c.magenta, -- Block-wise visual +-- R = c.light_pink, -- Replace +-- Rv = c.light_pink, -- Virtual replace +-- cv = c.dark_pink, -- Ex +-- r = c.red, -- Hit-enter +-- rm = c.red, -- More prompt +-- ["r?"] = c.red, -- :confirm +-- ["!"] = c.red, -- Shell command +-- t = c.red, -- Terminal +-- } +-- return { fg = mode_color[vim.fn.mode()] } +-- end, +-- padding = { right = 1 }, +-- }) +-- +-- left({ +-- "filename", +-- cond = conditions.buffer_not_empty, +-- color = { fg = c.dark_pink, gui = "bold" }, +-- }) +-- +-- left({ "location" }) +-- +-- left({ +-- function() +-- local cur = vim.fn.line(".") +-- local total = vim.fn.line("$") +-- return math.floor(cur / total * 100) .. "%%" +-- end, +-- color = { fg = c.fg, gui = "bold" }, +-- }) +-- +-- left({ +-- "diagnostics", +-- sources = { "nvim_diagnostic" }, +-- symbols = { error = " ", warn = " ", info = " ", hint = " " }, +-- diagnostics_color = { +-- error = { fg = c.error }, +-- warn = { fg = c.warning }, +-- info = { fg = c.info }, +-- hint = { fg = c.hint }, +-- }, +-- }) +-- +-- right({ +-- function() +-- if vim.api.nvim_get_vvar("hlsearch") == 1 then +-- local res = vim.fn.searchcount({ maxcount = 999, timeout = 500 }) +-- +-- if res.total > 0 then +-- return string.format("%d/%d", res.current, res.total) +-- end +-- end +-- +-- return "" +-- end, +-- }) +-- +-- right({ "filetype" }) +-- +-- right({ +-- "filesize", +-- cond = conditions.buffer_not_empty, +-- }) +-- +-- right({ +-- "o:encoding", +-- fmt = string.upper, +-- cond = conditions.hide_in_width, +-- color = { fg = c.red, gui = "bold" }, +-- }) +-- +-- right({ +-- "fileformat", +-- fmt = string.upper, +-- icons_enabled = false, +-- color = { fg = c.red, gui = "bold" }, +-- }) +-- +-- right({ +-- "branch", +-- icon = "", +-- color = { fg = c.orange, gui = "bold" }, +-- }) +-- +-- right({ +-- "diff", +-- symbols = { added = "+", modified = "~", removed = "-" }, +-- diff_color = { +-- added = { fg = c.diff.add }, +-- modified = { fg = c.diff.change }, +-- removed = { fg = c.diff.delete }, +-- }, +-- cond = conditions.hide_in_width, +-- }) +-- +-- right({ +-- function() +-- return "▊" +-- end, +-- color = { fg = c.gray }, +-- padding = { left = 1 }, +-- }) +-- +-- lualine.setup(config) +-- end, diff --git a/lua/custom/plugins/mini.lua b/lua/custom/plugins/mini.lua new file mode 100644 index 0000000..4360a77 --- /dev/null +++ b/lua/custom/plugins/mini.lua @@ -0,0 +1,7 @@ +return { + 'echasnovski/mini.nvim', + version = false, + config = function() + require('mini.surround').setup() + end +} diff --git a/lua/custom/plugins/neorg.lua b/lua/custom/plugins/neorg.lua index c9d3b20..60b1d17 100644 --- a/lua/custom/plugins/neorg.lua +++ b/lua/custom/plugins/neorg.lua @@ -1,32 +1,32 @@ return { - "nvim-neorg/neorg", - build = ":Neorg sync-parsers", - -- tag = "*", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - require("neorg").setup { - load = { - ["core.defaults"] = {}, - ["core.completion"] = { - config = { - engine = "nvim-cmp" - }, - }, - ["core.concealer"] = { - config = { - icon_preset = "diamond", - }, - }, - ["core.dirman"] = { - config = { - workspaces = { - notes = "~/study/notes", - }, - default_workspace = "notes", - index = "001_index.norg" - }, - }, - }, - } - end, + -- "nvim-neorg/neorg", + -- build = ":Neorg sync-parsers", + -- -- tag = "*", + -- dependencies = { "nvim-lua/plenary.nvim" }, + -- config = function() + -- require("neorg").setup { + -- load = { + -- ["core.defaults"] = {}, + -- ["core.completion"] = { + -- config = { + -- engine = "nvim-cmp" + -- }, + -- }, + -- ["core.concealer"] = { + -- config = { + -- icon_preset = "diamond", + -- }, + -- }, + -- ["core.dirman"] = { + -- config = { + -- workspaces = { + -- notes = "~/study/notes", + -- }, + -- default_workspace = "notes", + -- index = "001_index.norg" + -- }, + -- }, + -- }, + -- } + -- end, } diff --git a/lua/custom/plugins/orgmode.lua b/lua/custom/plugins/orgmode.lua new file mode 100644 index 0000000..45dbccc --- /dev/null +++ b/lua/custom/plugins/orgmode.lua @@ -0,0 +1,12 @@ +return { + 'nvim-orgmode/orgmode', + event = 'VeryLazy', + ft = { 'org' }, + config = function() + -- Setup orgmode + require('orgmode').setup({ + org_agenda_files = '~/orgfiles/**/*', + org_default_notes_file = '~/orgfiles/refile.org', + }) + end, +} diff --git a/lua/jabuxas/remap.lua b/lua/jabuxas/remap.lua index d36b77d..d39effc 100644 --- a/lua/jabuxas/remap.lua +++ b/lua/jabuxas/remap.lua @@ -22,7 +22,7 @@ keymap.set("n", "", "silent !tmux neww tmux-sessionizer") keymap.set("n", "f", vim.lsp.buf.format, { desc = "format current buffer" }) keymap.set("n", "pv", - ":Telescope file_browser path=%:p:h select_buffer=true", + ":Ex", { noremap = true, desc = "open file browser" }) keymap.set("n", "", "cnextzz") diff --git a/lua/jabuxas/set.lua b/lua/jabuxas/set.lua index 159d656..86f5fe0 100644 --- a/lua/jabuxas/set.lua +++ b/lua/jabuxas/set.lua @@ -1,4 +1,3 @@ --- vim.opt.guicursor = "" vim.opt.mouse = "a" vim.opt.nu = true @@ -55,6 +54,13 @@ autocmd("Filetype", { end }) +autocmd("Filetype", { + pattern = "*", + callback = function() + vim.o.formatoptions = "jql" + end +}) + vim.opt.conceallevel = 2 vim.opt.concealcursor = "n" diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 7fc783f..528fdaf 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -13,6 +13,7 @@ return { dependencies = { -- Creates a beautiful debugger UI 'rcarriga/nvim-dap-ui', + "nvim-neotest/nvim-nio", -- Installs the debug adapters for you 'williamboman/mason.nvim',