lots of updates

This commit is contained in:
Lucas Barbieri 2024-04-18 16:21:39 -03:00
parent 3fa5fab512
commit 8c28dafcb3
12 changed files with 275 additions and 254 deletions

View File

@ -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 = {

View File

@ -27,6 +27,7 @@ return {
else
options = {
show_buffer_icons = false,
diagnostics = "nvim_lsp",
}
end

View File

@ -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),

View File

@ -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", "<leader>le", function()
vim.cmd(string.format("Emmet %s", vim.fn.input("Emmet: ")))

View File

@ -1,4 +0,0 @@
return {
"nvim-telescope/telescope-file-browser.nvim",
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }
}

View File

@ -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,

View File

@ -0,0 +1,7 @@
return {
'echasnovski/mini.nvim',
version = false,
config = function()
require('mini.surround').setup()
end
}

View File

@ -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,
}

View File

@ -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,
}

View File

@ -22,7 +22,7 @@ keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
keymap.set("n", "<leader>f", vim.lsp.buf.format, { desc = "format current buffer" })
keymap.set("n",
"<leader>pv",
":Telescope file_browser path=%:p:h select_buffer=true<CR>",
":Ex<CR>",
{ noremap = true, desc = "open file browser" })
keymap.set("n", "<A-k>", "<cmd>cnext<CR>zz")

View File

@ -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"

View File

@ -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',