This commit is contained in:
Alexander Navarro 2023-08-28 09:46:49 -04:00
parent c6b065900c
commit f57508e19a
6 changed files with 256 additions and 46 deletions

View file

@ -5,6 +5,7 @@ return {
opts.sources = { opts.sources = {
null_ls.builtins.formatting.prettierd.with({ null_ls.builtins.formatting.prettierd.with({
disabled_filetypes = { "markdown" }, disabled_filetypes = { "markdown" },
extra_filetypes = { "astro" },
}), }),
null_ls.builtins.formatting.phpcsfixer.with({ null_ls.builtins.formatting.phpcsfixer.with({

View file

@ -20,6 +20,7 @@ return {
added = "", added = "",
modified = "", modified = "",
removed = "", removed = "",
branch = "",
}, },
kinds = { kinds = {
Array = "", Array = "",

View file

@ -5,41 +5,90 @@
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
vim.g.mapleader = " " vim.g.mapleader = " "
vim.g.maplocalleader = " " vim.g.maplocalleader = " "
--
-- -- Set highlight on search
-- vim.o.hlsearch = false
--
-- -- Make line numbers default
-- vim.wo.number = true
-- vim.opt.relativenumber = true
--
-- -- Enable mouse mode
-- vim.o.mouse = "a"
--
-- -- Sync clipboard between OS and Neovim.
-- -- Remove this option if you want your OS clipboard to remain independent.
-- -- See `:help 'clipboard'`
-- vim.o.clipboard = "unnamedplus"
--
-- -- Enable break indent
-- vim.o.breakindent = true
--
-- -- Save undo history
-- vim.o.undofile = true
--
-- -- Case insensitive searching UNLESS /C or capital in search
-- vim.o.ignorecase = true
-- vim.o.smartcase = true
--
-- -- Keep signcolumn on by default
-- vim.wo.signcolumn = "yes"
--
-- -- Decrease update time
-- vim.o.updatetime = 250
-- vim.o.timeout = true
-- vim.o.timeoutlen = 300
--
-- -- Set completeopt to have a better completion experience
-- vim.o.completeopt = "menuone,noselect"
--
-- -- NOTE: You should make sure your terminal supports this
-- vim.o.termguicolors = true
--
-- vim.o.showmode = false
-- vim.o.conceallevel = 3
-- Set highlight on search -- LazyVim options
vim.o.hlsearch = false local opt = vim.opt
-- Make line numbers default opt.autowrite = true -- Enable auto write
vim.wo.number = true opt.clipboard = "unnamedplus" -- Sync with system clipboard
opt.completeopt = "menu,menuone,noselect"
-- Enable mouse mode opt.conceallevel = 3 -- Hide * markup for bold and italic
vim.o.mouse = "a" opt.confirm = true -- Confirm to save changes before exiting modified buffer
opt.cursorline = true -- Enable highlighting of the current line
-- Sync clipboard between OS and Neovim. opt.expandtab = true -- Use spaces instead of tabs
-- Remove this option if you want your OS clipboard to remain independent. opt.formatoptions = "jcroqlnt" -- tcqj
-- See `:help 'clipboard'` opt.grepformat = "%f:%l:%c:%m"
vim.o.clipboard = "unnamedplus" opt.grepprg = "rg --vimgrep"
opt.ignorecase = true -- Ignore case
-- Enable break indent opt.inccommand = "nosplit" -- preview incremental substitute
vim.o.breakindent = true opt.laststatus = 0
opt.list = true -- Show some invisible characters (tabs...
-- Save undo history opt.mouse = "a" -- Enable mouse mode
vim.o.undofile = true opt.number = true -- Print line number
opt.pumblend = 10 -- Popup blend
-- Case insensitive searching UNLESS /C or capital in search opt.pumheight = 10 -- Maximum number of entries in a popup
vim.o.ignorecase = true opt.relativenumber = true -- Relative line numbers
vim.o.smartcase = true opt.scrolloff = 4 -- Lines of context
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
-- Keep signcolumn on by default opt.shiftround = true -- Round indent
vim.wo.signcolumn = "yes" opt.shiftwidth = 2 -- Size of an indent
opt.shortmess:append({ W = true, I = true, c = true })
-- Decrease update time opt.showmode = false -- Dont show mode since we have a statusline
vim.o.updatetime = 250 opt.sidescrolloff = 8 -- Columns of context
vim.o.timeout = true opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
vim.o.timeoutlen = 300 opt.smartcase = true -- Don't ignore case with capitals
opt.smartindent = true -- Insert indents automatically
-- Set completeopt to have a better completion experience opt.spelllang = { "en" }
vim.o.completeopt = "menuone,noselect" opt.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current
-- NOTE: You should make sure your terminal supports this opt.tabstop = 2 -- Number of spaces tabs count for
vim.o.termguicolors = true opt.termguicolors = true -- True color support
opt.timeoutlen = 300
opt.undofile = true
opt.undolevels = 10000
opt.updatetime = 200 -- Save swap file and trigger CursorHold
opt.wildmode = "longest:full,full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap

View file

@ -1,13 +1,88 @@
return { return {
-- Set lualine as statusline
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
-- See `:help lualine.txt` event = "VeryLazy",
opts = { depends = {
"nvim-tree/nvim-web-devicons",
},
opts = function()
local icons = require("aleidk.constants").icons
-- local Util = require("lazyvim.util")
--
local function diff_source()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed,
}
end
end
local function position_scrollbar(str)
local sbar = { "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" }
local curr_line = vim.api.nvim_win_get_cursor(0)[1]
local lines = vim.api.nvim_buf_line_count(0)
local i = math.floor((curr_line - 1) / lines * #sbar) + 1
return str .. " " .. sbar[i]
end
return {
options = { options = {
icons_enabled = false, theme = "auto",
theme = "onedark", globalstatus = true,
component_separators = "|", disabled_filetypes = { statusline = { "dashboard", "alpha" } },
component_separators = "",
section_separators = "", section_separators = "",
}, },
sections = {
lualine_a = {
{
"mode",
padding = 0,
fmt = function()
return " "
end,
}, },
},
lualine_b = {},
lualine_c = {
{ "branch", icon = icons.git.branch },
{
"diff",
symbols = {
added = icons.git.added,
modified = icons.git.modified,
removed = icons.git.removed,
},
source = diff_source,
},
{
"diagnostics",
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
},
},
lualine_x = {
{ "require'lsp-status'.status()" },
},
lualine_y = {
{ "location", padding = 0 },
{
"progress",
fmt = position_scrollbar,
separator = " ",
padding = 0,
},
},
lualine_z = {},
},
extensions = { "neo-tree", "lazy" },
}
end,
} }

View file

@ -0,0 +1,84 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
"MunifTanjim/nui.nvim",
-- OPTIONAL:
-- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback
"rcarriga/nvim-notify",
},
opts = {
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
routes = {
{
filter = {
event = "msg_show",
any = {
{ find = "%d+L, %d+B" },
{ find = "; after #%d+" },
{ find = "; before #%d+" },
},
},
view = "mini",
},
},
presets = {
bottom_search = true,
command_palette = true,
long_message_to_split = true,
inc_rename = true,
},
},
-- stylua: ignore
keys = {
{
"<S-Enter>",
function() require("noice").redirect(vim.fn.getcmdline()) end,
mode = "c",
desc =
"Redirect Cmdline"
},
{
"<leader>snl",
function() require("noice").cmd("last") end,
desc =
"Noice Last Message"
},
{
"<leader>snh",
function() require("noice").cmd("history") end,
desc =
"Noice History"
},
{ "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
{ "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
{
"<c-f>",
function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end,
silent = true,
expr = true,
desc =
"Scroll forward",
mode = {
"i", "n", "s" }
},
{
"<c-b>",
function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end,
silent = true,
expr = true,
desc =
"Scroll backward",
mode = {
"i", "n", "s" }
},
},
}

View file

@ -1,6 +1,6 @@
return { return {
"nvim-tree/nvim-tree.lua", "nvim-tree/nvim-tree.lua",
-- enabled = false, enabled = false,
version = "*", version = "*",
dependencies = { dependencies = {
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",