diff --git a/config/astronvim/lua/user/plugins/null-ls.lua b/config/astronvim/lua/user/plugins/null-ls.lua index fd9a8ae..28b6e1f 100644 --- a/config/astronvim/lua/user/plugins/null-ls.lua +++ b/config/astronvim/lua/user/plugins/null-ls.lua @@ -5,6 +5,7 @@ return { opts.sources = { null_ls.builtins.formatting.prettierd.with({ disabled_filetypes = { "markdown" }, + extra_filetypes = { "astro" }, }), null_ls.builtins.formatting.phpcsfixer.with({ diff --git a/config/nvim/lua/aleidk/constants.lua b/config/nvim/lua/aleidk/constants.lua index 2575ba6..ba67ee5 100644 --- a/config/nvim/lua/aleidk/constants.lua +++ b/config/nvim/lua/aleidk/constants.lua @@ -20,6 +20,7 @@ return { added = " ", modified = " ", removed = " ", + branch = "", }, kinds = { Array = " ", diff --git a/config/nvim/lua/aleidk/options.lua b/config/nvim/lua/aleidk/options.lua index e4557c8..47041ff 100644 --- a/config/nvim/lua/aleidk/options.lua +++ b/config/nvim/lua/aleidk/options.lua @@ -5,41 +5,90 @@ -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) vim.g.mapleader = " " 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 -vim.o.hlsearch = false +-- LazyVim options +local opt = vim.opt --- Make line numbers default -vim.wo.number = 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 +opt.autowrite = true -- Enable auto write +opt.clipboard = "unnamedplus" -- Sync with system clipboard +opt.completeopt = "menu,menuone,noselect" +opt.conceallevel = 3 -- Hide * markup for bold and italic +opt.confirm = true -- Confirm to save changes before exiting modified buffer +opt.cursorline = true -- Enable highlighting of the current line +opt.expandtab = true -- Use spaces instead of tabs +opt.formatoptions = "jcroqlnt" -- tcqj +opt.grepformat = "%f:%l:%c:%m" +opt.grepprg = "rg --vimgrep" +opt.ignorecase = true -- Ignore case +opt.inccommand = "nosplit" -- preview incremental substitute +opt.laststatus = 0 +opt.list = true -- Show some invisible characters (tabs... +opt.mouse = "a" -- Enable mouse mode +opt.number = true -- Print line number +opt.pumblend = 10 -- Popup blend +opt.pumheight = 10 -- Maximum number of entries in a popup +opt.relativenumber = true -- Relative line numbers +opt.scrolloff = 4 -- Lines of context +opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" } +opt.shiftround = true -- Round indent +opt.shiftwidth = 2 -- Size of an indent +opt.shortmess:append({ W = true, I = true, c = true }) +opt.showmode = false -- Dont show mode since we have a statusline +opt.sidescrolloff = 8 -- Columns of context +opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time +opt.smartcase = true -- Don't ignore case with capitals +opt.smartindent = true -- Insert indents automatically +opt.spelllang = { "en" } +opt.splitbelow = true -- Put new windows below current +opt.splitright = true -- Put new windows right of current +opt.tabstop = 2 -- Number of spaces tabs count for +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 diff --git a/config/nvim/lua/aleidk/plugins/lualine.lua b/config/nvim/lua/aleidk/plugins/lualine.lua index f9c97a2..66e7ef5 100644 --- a/config/nvim/lua/aleidk/plugins/lualine.lua +++ b/config/nvim/lua/aleidk/plugins/lualine.lua @@ -1,13 +1,88 @@ return { - -- Set lualine as statusline "nvim-lualine/lualine.nvim", - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = "onedark", - component_separators = "|", - section_separators = "", - }, + event = "VeryLazy", + 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 = { + theme = "auto", + globalstatus = true, + disabled_filetypes = { statusline = { "dashboard", "alpha" } }, + component_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, } diff --git a/config/nvim/lua/aleidk/plugins/noice.lua b/config/nvim/lua/aleidk/plugins/noice.lua new file mode 100644 index 0000000..3f01390 --- /dev/null +++ b/config/nvim/lua/aleidk/plugins/noice.lua @@ -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 = { + { + "", + function() require("noice").redirect(vim.fn.getcmdline()) end, + mode = "c", + desc = + "Redirect Cmdline" + }, + { + "snl", + function() require("noice").cmd("last") end, + desc = + "Noice Last Message" + }, + { + "snh", + function() require("noice").cmd("history") end, + desc = + "Noice History" + }, + { "sna", function() require("noice").cmd("all") end, desc = "Noice All" }, + { "snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" }, + { + "", + function() if not require("noice.lsp").scroll(4) then return "" end end, + silent = true, + expr = true, + desc = + "Scroll forward", + mode = { + "i", "n", "s" } + }, + { + "", + function() if not require("noice.lsp").scroll(-4) then return "" end end, + silent = true, + expr = true, + desc = + "Scroll backward", + mode = { + "i", "n", "s" } + }, + }, +} diff --git a/config/nvim/lua/aleidk/plugins/nvim-tree.lua b/config/nvim/lua/aleidk/plugins/nvim-tree.lua index ecbd607..24dbf4e 100644 --- a/config/nvim/lua/aleidk/plugins/nvim-tree.lua +++ b/config/nvim/lua/aleidk/plugins/nvim-tree.lua @@ -1,6 +1,6 @@ return { "nvim-tree/nvim-tree.lua", - -- enabled = false, + enabled = false, version = "*", dependencies = { "nvim-tree/nvim-web-devicons",