Update Neovim and Emacs configurations
This commit is contained in:
46
emacs/.emacs
46
emacs/.emacs
@@ -3,9 +3,13 @@
|
||||
(message "Loading user configuration...")
|
||||
|
||||
;; Setting variables
|
||||
;; (setq os-packages-path "/home/fscotto/.emacs.d/packages/")
|
||||
(setq vc-follow-symlinks 't)
|
||||
(prefer-coding-system 'utf-8-unix)
|
||||
(setq custom-file (null-device))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; PACKAGES ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; Initialize package system via use-package
|
||||
(package-initialize)
|
||||
@@ -25,6 +29,27 @@
|
||||
("gnu" . "https://elpa.gnu.org/packages/")))
|
||||
)
|
||||
|
||||
(use-package catppuccin-theme
|
||||
:ensure t)
|
||||
|
||||
(use-package hl-todo
|
||||
:ensure t)
|
||||
|
||||
(setq hl-todo-keyword-faces
|
||||
'(("TODO" . "#94e2d5")
|
||||
("FIXME" . "#f38ba8")
|
||||
("DEBUG" . "#cba6f7")
|
||||
("GOTCHA" . "#eba0ac")
|
||||
("STUB" . "#89b4fa")))
|
||||
|
||||
(with-eval-after-load 'magit
|
||||
(add-hook 'magit-log-wash-summary-hook
|
||||
#'hl-todo-search-and-highlight t)
|
||||
(add-hook 'magit-revision-wash-message-hook
|
||||
#'hl-todo-search-and-highlighthl t))
|
||||
|
||||
;; TODO adding lsp-mode, dap-mode, autocomplete and project handling for C, Go, Bash and Python
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; LOOK AND FEEL ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
@@ -33,12 +58,21 @@
|
||||
(load-theme 'catppuccin :no-confirm)
|
||||
|
||||
;; Setting default font
|
||||
(set-frame-font "JetBrainsMono Nerd Font 16" nil t)
|
||||
(set-frame-font "0xProto Nerd Font 16" nil t)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; PACKAGES ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Remove toolbar
|
||||
(tool-bar-mode -1)
|
||||
|
||||
;;
|
||||
;; Remove menu
|
||||
(menu-bar-mode -1)
|
||||
|
||||
;; Disable startup screen
|
||||
(setq inhibit-startup-screen t)
|
||||
|
||||
;; Disable splash screen
|
||||
(setq inhibit-splash-screen t)
|
||||
|
||||
;; Enable line numbers in the programming mode only
|
||||
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
|
||||
|
||||
(message "...user configuration loaded")
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
{
|
||||
"LazyVim": { "branch": "main", "commit": "25abbf546d564dc484cf903804661ba12de45507" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "8e74c08998fd786239caba373344f4e4601e21fe" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "dc34600801650c2c8bf62125b1f70f6cfffcc057" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" },
|
||||
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||
"catppuccin": { "branch": "main", "commit": "30fa4d122d9b22ad8b2e0ab1b533c8c26c4dde86" },
|
||||
"clangd_extensions.nvim": { "branch": "main", "commit": "b67cc417d9020fb4b83d46662351b4d16894905e" },
|
||||
"conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
|
||||
"dial.nvim": { "branch": "master", "commit": "78bd73aaf2b9c8f80715a878feaf56f7ffa8b6ff" },
|
||||
"dial.nvim": { "branch": "master", "commit": "f0404ec1f83a03f2c3457e60087c6331d1cbb83f" },
|
||||
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"fzf-lua": { "branch": "main", "commit": "2c4c75e71eedbedd55ea13ab3400f72a2336e672" },
|
||||
"fzf-lua": { "branch": "main", "commit": "091bcd0c925199b1371ea81ec79278611d299627" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" },
|
||||
"glow.nvim": { "branch": "main", "commit": "5d5954b2f22e109d4a6eba8b2618c5b96e4ee7a2" },
|
||||
"grug-far.nvim": { "branch": "main", "commit": "385d1949dc21d0c39e7a74b4f4a25da18817bc86" },
|
||||
"hardtime.nvim": { "branch": "main", "commit": "6d7664d5bdfaea44c5f50b29f5239fab7b00c273" },
|
||||
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
|
||||
@@ -24,29 +23,31 @@
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "86389a3dd687cfaa647b6f44731e492970034baa" },
|
||||
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
||||
"mini.ai": { "branch": "main", "commit": "50994f55b6de0c2781e217c2d5e4a613312e460e" },
|
||||
"mini.icons": { "branch": "main", "commit": "b8f6fa6f5a3fd0c56936252edcd691184e5aac0c" },
|
||||
"mini.pairs": { "branch": "main", "commit": "1e1ca3f60f58d4050bf814902b472eec9963a5dd" },
|
||||
"mini.ai": { "branch": "main", "commit": "45a26d032d8703f280c69c2ed9fb4e1bfc8f24f9" },
|
||||
"mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" },
|
||||
"mini.nvim": { "branch": "main", "commit": "ddb70da6ec6aa896cfde87350d1e8dffb57ddef0" },
|
||||
"mini.pairs": { "branch": "main", "commit": "6e1cc569130f25b2c6fa16d8b21b31ddb1420a4a" },
|
||||
"multicursors.nvim": { "branch": "main", "commit": "72225ea9e4443c3f4b9df91d0193e07c4ee8d382" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "46fa0c22ca39e05fe15744102d21feb07fe9a94a" },
|
||||
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "53ec77181d96494b9dc9457110dd62dc623cc78d" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-dap": { "branch": "master", "commit": "968f89f8aac11b6bdbfc942c71d3436658c1435f" },
|
||||
"nvim-dap": { "branch": "master", "commit": "7891b01beedc37cef4eaf2e92563bd0a5b6e9c58" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" },
|
||||
"nvim-dap-python": { "branch": "master", "commit": "030385d03363988370adaa5cf21fa465daddb088" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||
"nvim-lint": { "branch": "master", "commit": "ee04d481d4e6089892c2fb2ad8924b1a053591e1" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "3d97ec4174bcc750d70718ddedabf150536a5891" },
|
||||
"nvim-lint": { "branch": "master", "commit": "f126af5345c7472e9a0cdbe1d1a29209be72c4c4" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "a3deebbd110016f50cc66b7b256120072f3804db" },
|
||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "f66cdfef5e84112045b9ebc3119fee9bddb3c687" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"refactoring.nvim": { "branch": "master", "commit": "74b608dfee827c2372250519d433cc21cb083407" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "f626e90bbc4b3d8f4fd29c909d958b165af13f4a" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "e76eb2e4262f0f0a1a7bd7a454dd7d44f1299afd" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
@@ -55,5 +56,5 @@
|
||||
"ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" },
|
||||
"venv-selector.nvim": { "branch": "regexp", "commit": "d2326e7433fdeb10f7d0d1237c18b91b353f9f8b" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" },
|
||||
"yazi.nvim": { "branch": "main", "commit": "66a659291f85517994886bb641567ce7c7d5368b" }
|
||||
"yazi.nvim": { "branch": "main", "commit": "8ce0abb50c30fdc486c465ddfab28510346e6bd7" }
|
||||
}
|
||||
|
||||
@@ -15,9 +15,6 @@ map({ "n", "v" }, "<leader>y", [["+y]], { noremap = true, silent = true, desc =
|
||||
-- Paste from system clipboard
|
||||
map("n", "<leader>p", [["+p]], { noremap = true, silent = true, desc = "Paste from system clipboard" })
|
||||
|
||||
-- Markdown menu
|
||||
map("n", "<leader>M", [["+M]], { noremap = true, silent = true, desc = "Markdown" })
|
||||
|
||||
vim.keymap.set("n", "<leader>cc", function()
|
||||
local file1 = vim.fn.expand("%")
|
||||
|
||||
|
||||
@@ -5,15 +5,17 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Start LazyVim plugins
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
@@ -48,3 +50,121 @@ require("lazy").setup({
|
||||
},
|
||||
cache = true,
|
||||
})
|
||||
|
||||
-- Configure status bar
|
||||
require("config.statusline")
|
||||
|
||||
-- Configure Markdown rendering rules
|
||||
require("render-markdown").setup({
|
||||
heading = { position = "inline" },
|
||||
quote = { repeat_linebreak = true },
|
||||
win_options = {
|
||||
showbreak = {
|
||||
default = "",
|
||||
rendered = " ",
|
||||
},
|
||||
breakindent = {
|
||||
default = false,
|
||||
rendered = true,
|
||||
},
|
||||
breakindentopt = {
|
||||
default = "",
|
||||
rendered = "",
|
||||
},
|
||||
},
|
||||
checkbox = {
|
||||
unchecked = { icon = "✘ " },
|
||||
checked = { icon = "✔ " },
|
||||
},
|
||||
code = {
|
||||
position = "right",
|
||||
width = "block",
|
||||
right_pad = 10,
|
||||
},
|
||||
latex = {
|
||||
enabled = false,
|
||||
},
|
||||
link = {
|
||||
custom = {
|
||||
c = {
|
||||
pattern = "%.[ch]$",
|
||||
icon = " ",
|
||||
},
|
||||
golang = {
|
||||
pattern = "%.go$",
|
||||
icon = " ",
|
||||
},
|
||||
python = {
|
||||
pattern = "%.py$",
|
||||
icon = " ",
|
||||
},
|
||||
lua = {
|
||||
pattern = "%.lua$",
|
||||
icon = " ",
|
||||
},
|
||||
-- shell = {
|
||||
-- pattern = "%.[sh|zsh]$",
|
||||
-- icon = " ",
|
||||
-- },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Configure TreeSitter syntax parsers
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
|
||||
ensure_installed = {
|
||||
"c",
|
||||
"lua",
|
||||
"bash",
|
||||
"go",
|
||||
"gomod",
|
||||
"gowork",
|
||||
"gosum",
|
||||
"json",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"zig",
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
-- List of parsers to ignore installing (or "all")
|
||||
ignore_install = { "javascript" },
|
||||
|
||||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
||||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
|
||||
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
|
||||
-- the name of the parser)
|
||||
-- list of language that will be disabled
|
||||
disable = {},
|
||||
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
|
||||
disable = function(lang, buf)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
})
|
||||
|
||||
-- Configure Mini.AI for textobjects command
|
||||
require("mini.ai").setup()
|
||||
|
||||
@@ -30,9 +30,9 @@ opt.termguicolors = true
|
||||
opt.clipboard = "unnamedplus"
|
||||
|
||||
-- Indentation
|
||||
opt.softtabstop = 8
|
||||
opt.shiftwidth = 8
|
||||
opt.tabstop = 8
|
||||
-- opt.softtabstop = 8
|
||||
-- opt.shiftwidth = 8
|
||||
-- opt.tabstop = 8
|
||||
opt.expandtab = true
|
||||
opt.smartindent = true
|
||||
|
||||
|
||||
219
lazyvim/.config/nvim/lua/config/statusline.lua
Executable file
219
lazyvim/.config/nvim/lua/config/statusline.lua
Executable file
@@ -0,0 +1,219 @@
|
||||
-- Eviline config for lualine
|
||||
-- Author: shadmansaleh
|
||||
-- Credit: glepnir
|
||||
local lualine = require("lualine")
|
||||
|
||||
-- Color table for highlights
|
||||
-- stylua: ignore
|
||||
local colors = {
|
||||
bg = '#202328',
|
||||
fg = '#bbc2cf',
|
||||
yellow = '#ECBE7B',
|
||||
cyan = '#008080',
|
||||
darkblue = '#081633',
|
||||
green = '#98be65',
|
||||
orange = '#FF8800',
|
||||
violet = '#a9a1e1',
|
||||
magenta = '#c678dd',
|
||||
blue = '#51afef',
|
||||
red = '#ec5f67',
|
||||
}
|
||||
|
||||
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 = "catppuccin",
|
||||
},
|
||||
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 ins_left(component)
|
||||
table.insert(config.sections.lualine_c, component)
|
||||
end
|
||||
|
||||
-- Inserts a component in lualine_x at right section
|
||||
local function ins_right(component)
|
||||
table.insert(config.sections.lualine_x, component)
|
||||
end
|
||||
|
||||
ins_left({
|
||||
function()
|
||||
return "▊"
|
||||
end,
|
||||
color = { fg = colors.blue }, -- Sets highlighting of component
|
||||
padding = { left = 0, right = 1 }, -- We don't need space before this
|
||||
})
|
||||
|
||||
-- -- Function to get the current mode indicator as a single character
|
||||
local function mode()
|
||||
-- Map of modes to their respective shorthand indicators
|
||||
local mode_map = {
|
||||
n = "NORMAL", -- Normal mode
|
||||
v = "VISUAL", -- Visual mode
|
||||
[""] = "VISUAL BLOCK", -- Visual block mode
|
||||
V = "VISUAL LINE", -- Visual line mode
|
||||
c = "COMMAND", -- Command-line mode
|
||||
no = "N-INSERT", -- NInsert mode
|
||||
s = "SELECT", -- Select mode
|
||||
S = "SELECT-LINE", -- Select line mode
|
||||
ic = "INSERT", -- Insert mode (completion)
|
||||
R = "REPLACE", -- Replace mode
|
||||
Rv = "VISUAL REPLACE", -- Virtual Replace mode
|
||||
cv = "COMMAND-LINE", -- Command-line mode
|
||||
ce = "C", -- Ex mode
|
||||
r = "R", -- Prompt mode
|
||||
rm = "M", -- More mode
|
||||
["r?"] = "?", -- Confirm mode
|
||||
["!"] = "!", -- Shell mode
|
||||
t = "TERMINAL", -- Terminal mode
|
||||
}
|
||||
-- Return the mode shorthand or [UNKNOWN] if no match
|
||||
return mode_map[vim.fn.mode()] or "[UNKNOWN]"
|
||||
end
|
||||
|
||||
ins_left({
|
||||
-- mode component
|
||||
mode,
|
||||
color = function()
|
||||
-- auto change color according to neovims mode
|
||||
local mode_color = {
|
||||
n = colors.red,
|
||||
i = colors.green,
|
||||
v = colors.blue,
|
||||
[""] = colors.blue,
|
||||
V = colors.blue,
|
||||
c = colors.magenta,
|
||||
no = colors.red,
|
||||
s = colors.orange,
|
||||
S = colors.orange,
|
||||
[""] = colors.orange,
|
||||
ic = colors.yellow,
|
||||
R = colors.violet,
|
||||
Rv = colors.violet,
|
||||
cv = colors.red,
|
||||
ce = colors.red,
|
||||
r = colors.cyan,
|
||||
rm = colors.cyan,
|
||||
["r?"] = colors.cyan,
|
||||
["!"] = colors.red,
|
||||
t = colors.red,
|
||||
}
|
||||
return { fg = mode_color[vim.fn.mode()] }
|
||||
end,
|
||||
padding = { right = 1 },
|
||||
})
|
||||
|
||||
ins_left({
|
||||
-- filesize component
|
||||
"filesize",
|
||||
cond = conditions.buffer_not_empty,
|
||||
})
|
||||
|
||||
ins_left({
|
||||
"filename",
|
||||
cond = conditions.buffer_not_empty,
|
||||
color = { fg = colors.magenta, gui = "bold" },
|
||||
})
|
||||
|
||||
ins_left({ "location" })
|
||||
|
||||
ins_left({ "progress", color = { fg = colors.fg, gui = "bold" } })
|
||||
|
||||
ins_left({
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
symbols = { error = " ", warn = " ", info = " " },
|
||||
diagnostics_color = {
|
||||
error = { fg = colors.red },
|
||||
warn = { fg = colors.yellow },
|
||||
info = { fg = colors.cyan },
|
||||
},
|
||||
})
|
||||
|
||||
-- Insert mid section. You can make any number of sections in neovim :)
|
||||
-- for lualine it's any number greater then 2
|
||||
ins_left({
|
||||
function()
|
||||
return "%="
|
||||
end,
|
||||
})
|
||||
|
||||
-- Add components to right sections
|
||||
ins_right({
|
||||
"o:encoding", -- option component same as &encoding in viml
|
||||
fmt = string.upper, -- I'm not sure why it's upper case either ;)
|
||||
cond = conditions.hide_in_width,
|
||||
color = { fg = colors.green, gui = "bold" },
|
||||
})
|
||||
|
||||
ins_right({
|
||||
"fileformat",
|
||||
fmt = string.upper,
|
||||
icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh
|
||||
color = { fg = colors.green, gui = "bold" },
|
||||
})
|
||||
|
||||
ins_right({
|
||||
"branch",
|
||||
icon = "",
|
||||
color = { fg = colors.violet, gui = "bold" },
|
||||
})
|
||||
|
||||
ins_right({
|
||||
"diff",
|
||||
-- Is it me or the symbol for modified us really weird
|
||||
symbols = { added = " ", modified = " ", removed = " " },
|
||||
diff_color = {
|
||||
added = { fg = colors.green },
|
||||
modified = { fg = colors.orange },
|
||||
removed = { fg = colors.red },
|
||||
},
|
||||
cond = conditions.hide_in_width,
|
||||
})
|
||||
|
||||
ins_right({
|
||||
function()
|
||||
return "▊"
|
||||
end,
|
||||
color = { fg = colors.blue },
|
||||
padding = { left = 1 },
|
||||
})
|
||||
|
||||
-- Now don't forget to initialize lualine
|
||||
lualine.setup(config)
|
||||
@@ -9,7 +9,7 @@ return {
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("catppuccin").setup(opts)
|
||||
-- vim.cmd.colorscheme("catppuccin")
|
||||
-- vim.cmd.colorscheme("catppuccin-mocha")
|
||||
vim.cmd.colorscheme("tokyonight-night")
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
return {
|
||||
"m4xshen/hardtime.nvim",
|
||||
lazy = false,
|
||||
dependencies = { "MunifTanjim/nui.nvim" },
|
||||
enabled = false,
|
||||
opts = {},
|
||||
"m4xshen/hardtime.nvim",
|
||||
lazy = false,
|
||||
dependencies = { "MunifTanjim/nui.nvim" },
|
||||
enabled = false,
|
||||
opts = {},
|
||||
}
|
||||
|
||||
4
lazyvim/.config/nvim/lua/plugins/lualine.lua
Executable file
4
lazyvim/.config/nvim/lua/plugins/lualine.lua
Executable file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
}
|
||||
@@ -1,37 +1,9 @@
|
||||
return {
|
||||
-- Browser preview plugin
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = "cd app && yarn install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
vim.g.mkdp_auto_start = 0
|
||||
vim.g.mkdp_browser = "firefox" -- use your preferred browser
|
||||
vim.g.mkdp_sync_scroll_type = "middle"
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>Mp",
|
||||
"<cmd>MarkdownPreviewToggle<CR>",
|
||||
desc = "Preview Markdown (Browser)",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Terminal-based preview with Glow
|
||||
{
|
||||
"ellisonleao/glow.nvim",
|
||||
config = true, -- uses default config
|
||||
cmd = "Glow",
|
||||
ft = { "markdown" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>Mg",
|
||||
"<cmd>Glow<CR>",
|
||||
desc = "Preview Markdown (Glow)",
|
||||
},
|
||||
},
|
||||
},
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
|
||||
---@module 'render-markdown'
|
||||
---@type render.md.UserConfig
|
||||
opts = {},
|
||||
}
|
||||
|
||||
522
lazyvim/.config/nvim/lua/plugins/snacks.lua
Executable file
522
lazyvim/.config/nvim/lua/plugins/snacks.lua
Executable file
@@ -0,0 +1,522 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
bigfile = { enabled = true },
|
||||
dashboard = { enabled = false },
|
||||
explorer = { enabled = false },
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
notifier = {
|
||||
enabled = true,
|
||||
timeout = 3000,
|
||||
},
|
||||
picker = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
scroll = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
words = { enabled = true },
|
||||
styles = {
|
||||
notification = {
|
||||
-- wo = { wrap = true } -- Wrap notifications
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
-- Top Pickers & Explorer
|
||||
{
|
||||
"<leader><space>",
|
||||
function()
|
||||
Snacks.picker.smart()
|
||||
end,
|
||||
desc = "Smart Find Files",
|
||||
},
|
||||
{
|
||||
"<leader>,",
|
||||
function()
|
||||
Snacks.picker.buffers()
|
||||
end,
|
||||
desc = "Buffers",
|
||||
},
|
||||
{
|
||||
"<leader>/",
|
||||
function()
|
||||
Snacks.picker.grep()
|
||||
end,
|
||||
desc = "Grep",
|
||||
},
|
||||
{
|
||||
"<leader>:",
|
||||
function()
|
||||
Snacks.picker.command_history()
|
||||
end,
|
||||
desc = "Command History",
|
||||
},
|
||||
{
|
||||
"<leader>n",
|
||||
function()
|
||||
Snacks.picker.notifications()
|
||||
end,
|
||||
desc = "Notification History",
|
||||
},
|
||||
{
|
||||
"<leader>fb",
|
||||
function()
|
||||
Snacks.picker.buffers()
|
||||
end,
|
||||
desc = "Buffers",
|
||||
},
|
||||
{
|
||||
"<leader>fc",
|
||||
function()
|
||||
Snacks.picker.files({ cwd = vim.fn.stdpath("config") })
|
||||
end,
|
||||
desc = "Find Config File",
|
||||
},
|
||||
{
|
||||
"<leader>ff",
|
||||
function()
|
||||
Snacks.picker.files()
|
||||
end,
|
||||
desc = "Find Files",
|
||||
},
|
||||
{
|
||||
"<leader>fg",
|
||||
function()
|
||||
Snacks.picker.git_files()
|
||||
end,
|
||||
desc = "Find Git Files",
|
||||
},
|
||||
{
|
||||
"<leader>fp",
|
||||
function()
|
||||
Snacks.picker.projects()
|
||||
end,
|
||||
desc = "Projects",
|
||||
},
|
||||
{
|
||||
"<leader>fr",
|
||||
function()
|
||||
Snacks.picker.recent()
|
||||
end,
|
||||
desc = "Recent",
|
||||
},
|
||||
-- git
|
||||
{
|
||||
"<leader>gb",
|
||||
function()
|
||||
Snacks.picker.git_branches()
|
||||
end,
|
||||
desc = "Git Branches",
|
||||
},
|
||||
{
|
||||
"<leader>gl",
|
||||
function()
|
||||
Snacks.picker.git_log()
|
||||
end,
|
||||
desc = "Git Log",
|
||||
},
|
||||
{
|
||||
"<leader>gL",
|
||||
function()
|
||||
Snacks.picker.git_log_line()
|
||||
end,
|
||||
desc = "Git Log Line",
|
||||
},
|
||||
{
|
||||
"<leader>gs",
|
||||
function()
|
||||
Snacks.picker.git_status()
|
||||
end,
|
||||
desc = "Git Status",
|
||||
},
|
||||
{
|
||||
"<leader>gS",
|
||||
function()
|
||||
Snacks.picker.git_stash()
|
||||
end,
|
||||
desc = "Git Stash",
|
||||
},
|
||||
{
|
||||
"<leader>gd",
|
||||
function()
|
||||
Snacks.picker.git_diff()
|
||||
end,
|
||||
desc = "Git Diff (Hunks)",
|
||||
},
|
||||
{
|
||||
"<leader>gf",
|
||||
function()
|
||||
Snacks.picker.git_log_file()
|
||||
end,
|
||||
desc = "Git Log File",
|
||||
},
|
||||
-- Grep
|
||||
{
|
||||
"<leader>sb",
|
||||
function()
|
||||
Snacks.picker.lines()
|
||||
end,
|
||||
desc = "Buffer Lines",
|
||||
},
|
||||
{
|
||||
"<leader>sB",
|
||||
function()
|
||||
Snacks.picker.grep_buffers()
|
||||
end,
|
||||
desc = "Grep Open Buffers",
|
||||
},
|
||||
{
|
||||
"<leader>sg",
|
||||
function()
|
||||
Snacks.picker.grep()
|
||||
end,
|
||||
desc = "Grep",
|
||||
},
|
||||
{
|
||||
"<leader>sw",
|
||||
function()
|
||||
Snacks.picker.grep_word()
|
||||
end,
|
||||
desc = "Visual selection or word",
|
||||
mode = { "n", "x" },
|
||||
},
|
||||
-- search
|
||||
{
|
||||
'<leader>s"',
|
||||
function()
|
||||
Snacks.picker.registers()
|
||||
end,
|
||||
desc = "Registers",
|
||||
},
|
||||
{
|
||||
"<leader>s/",
|
||||
function()
|
||||
Snacks.picker.search_history()
|
||||
end,
|
||||
desc = "Search History",
|
||||
},
|
||||
{
|
||||
"<leader>sa",
|
||||
function()
|
||||
Snacks.picker.autocmds()
|
||||
end,
|
||||
desc = "Autocmds",
|
||||
},
|
||||
{
|
||||
"<leader>sb",
|
||||
function()
|
||||
Snacks.picker.lines()
|
||||
end,
|
||||
desc = "Buffer Lines",
|
||||
},
|
||||
{
|
||||
"<leader>sc",
|
||||
function()
|
||||
Snacks.picker.command_history()
|
||||
end,
|
||||
desc = "Command History",
|
||||
},
|
||||
{
|
||||
"<leader>sC",
|
||||
function()
|
||||
Snacks.picker.commands()
|
||||
end,
|
||||
desc = "Commands",
|
||||
},
|
||||
{
|
||||
"<leader>sd",
|
||||
function()
|
||||
Snacks.picker.diagnostics()
|
||||
end,
|
||||
desc = "Diagnostics",
|
||||
},
|
||||
{
|
||||
"<leader>sD",
|
||||
function()
|
||||
Snacks.picker.diagnostics_buffer()
|
||||
end,
|
||||
desc = "Buffer Diagnostics",
|
||||
},
|
||||
{
|
||||
"<leader>sh",
|
||||
function()
|
||||
Snacks.picker.help()
|
||||
end,
|
||||
desc = "Help Pages",
|
||||
},
|
||||
{
|
||||
"<leader>sH",
|
||||
function()
|
||||
Snacks.picker.highlights()
|
||||
end,
|
||||
desc = "Highlights",
|
||||
},
|
||||
{
|
||||
"<leader>si",
|
||||
function()
|
||||
Snacks.picker.icons()
|
||||
end,
|
||||
desc = "Icons",
|
||||
},
|
||||
{
|
||||
"<leader>sj",
|
||||
function()
|
||||
Snacks.picker.jumps()
|
||||
end,
|
||||
desc = "Jumps",
|
||||
},
|
||||
{
|
||||
"<leader>sk",
|
||||
function()
|
||||
Snacks.picker.keymaps()
|
||||
end,
|
||||
desc = "Keymaps",
|
||||
},
|
||||
{
|
||||
"<leader>sl",
|
||||
function()
|
||||
Snacks.picker.loclist()
|
||||
end,
|
||||
desc = "Location List",
|
||||
},
|
||||
{
|
||||
"<leader>sm",
|
||||
function()
|
||||
Snacks.picker.marks()
|
||||
end,
|
||||
desc = "Marks",
|
||||
},
|
||||
{
|
||||
"<leader>sM",
|
||||
function()
|
||||
Snacks.picker.man()
|
||||
end,
|
||||
desc = "Man Pages",
|
||||
},
|
||||
{
|
||||
"<leader>sp",
|
||||
function()
|
||||
Snacks.picker.lazy()
|
||||
end,
|
||||
desc = "Search for Plugin Spec",
|
||||
},
|
||||
{
|
||||
"<leader>sq",
|
||||
function()
|
||||
Snacks.picker.qflist()
|
||||
end,
|
||||
desc = "Quickfix List",
|
||||
},
|
||||
{
|
||||
"<leader>sR",
|
||||
function()
|
||||
Snacks.picker.resume()
|
||||
end,
|
||||
desc = "Resume",
|
||||
},
|
||||
{
|
||||
"<leader>su",
|
||||
function()
|
||||
Snacks.picker.undo()
|
||||
end,
|
||||
desc = "Undo History",
|
||||
},
|
||||
{
|
||||
"<leader>uC",
|
||||
function()
|
||||
Snacks.picker.colorschemes()
|
||||
end,
|
||||
desc = "Colorschemes",
|
||||
},
|
||||
-- LSP
|
||||
{
|
||||
"gd",
|
||||
function()
|
||||
Snacks.picker.lsp_definitions()
|
||||
end,
|
||||
desc = "Goto Definition",
|
||||
},
|
||||
{
|
||||
"gD",
|
||||
function()
|
||||
Snacks.picker.lsp_declarations()
|
||||
end,
|
||||
desc = "Goto Declaration",
|
||||
},
|
||||
{
|
||||
"gr",
|
||||
function()
|
||||
Snacks.picker.lsp_references()
|
||||
end,
|
||||
nowait = true,
|
||||
desc = "References",
|
||||
},
|
||||
{
|
||||
"gI",
|
||||
function()
|
||||
Snacks.picker.lsp_implementations()
|
||||
end,
|
||||
desc = "Goto Implementation",
|
||||
},
|
||||
{
|
||||
"gy",
|
||||
function()
|
||||
Snacks.picker.lsp_type_definitions()
|
||||
end,
|
||||
desc = "Goto T[y]pe Definition",
|
||||
},
|
||||
{
|
||||
"<leader>ss",
|
||||
function()
|
||||
Snacks.picker.lsp_symbols()
|
||||
end,
|
||||
desc = "LSP Symbols",
|
||||
},
|
||||
{
|
||||
"<leader>sS",
|
||||
function()
|
||||
Snacks.picker.lsp_workspace_symbols()
|
||||
end,
|
||||
desc = "LSP Workspace Symbols",
|
||||
},
|
||||
-- Other
|
||||
{
|
||||
"<leader>z",
|
||||
function()
|
||||
Snacks.zen()
|
||||
end,
|
||||
desc = "Toggle Zen Mode",
|
||||
},
|
||||
{
|
||||
"<leader>Z",
|
||||
function()
|
||||
Snacks.zen.zoom()
|
||||
end,
|
||||
desc = "Toggle Zoom",
|
||||
},
|
||||
{
|
||||
"<leader>.",
|
||||
function()
|
||||
Snacks.scratch()
|
||||
end,
|
||||
desc = "Toggle Scratch Buffer",
|
||||
},
|
||||
{
|
||||
"<leader>S",
|
||||
function()
|
||||
Snacks.scratch.select()
|
||||
end,
|
||||
desc = "Select Scratch Buffer",
|
||||
},
|
||||
{
|
||||
"<leader>n",
|
||||
function()
|
||||
Snacks.notifier.show_history()
|
||||
end,
|
||||
desc = "Notification History",
|
||||
},
|
||||
{
|
||||
"<leader>bd",
|
||||
function()
|
||||
Snacks.bufdelete()
|
||||
end,
|
||||
desc = "Delete Buffer",
|
||||
},
|
||||
{
|
||||
"<leader>cR",
|
||||
function()
|
||||
Snacks.rename.rename_file()
|
||||
end,
|
||||
desc = "Rename File",
|
||||
},
|
||||
{
|
||||
"<leader>gB",
|
||||
function()
|
||||
Snacks.gitbrowse()
|
||||
end,
|
||||
desc = "Git Browse",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
{
|
||||
"<leader>gg",
|
||||
function()
|
||||
Snacks.lazygit()
|
||||
end,
|
||||
desc = "Lazygit",
|
||||
},
|
||||
{
|
||||
"<leader>un",
|
||||
function()
|
||||
Snacks.notifier.hide()
|
||||
end,
|
||||
desc = "Dismiss All Notifications",
|
||||
},
|
||||
{
|
||||
"<c-/>",
|
||||
function()
|
||||
Snacks.terminal()
|
||||
end,
|
||||
desc = "Toggle Terminal",
|
||||
},
|
||||
{
|
||||
"<c-_>",
|
||||
function()
|
||||
Snacks.terminal()
|
||||
end,
|
||||
desc = "which_key_ignore",
|
||||
},
|
||||
{
|
||||
"]]",
|
||||
function()
|
||||
Snacks.words.jump(vim.v.count1)
|
||||
end,
|
||||
desc = "Next Reference",
|
||||
mode = { "n", "t" },
|
||||
},
|
||||
{
|
||||
"[[",
|
||||
function()
|
||||
Snacks.words.jump(-vim.v.count1)
|
||||
end,
|
||||
desc = "Prev Reference",
|
||||
mode = { "n", "t" },
|
||||
},
|
||||
{
|
||||
"<leader>N",
|
||||
desc = "Neovim News",
|
||||
function()
|
||||
Snacks.win({
|
||||
file = vim.api.nvim_get_runtime_file("doc/news.txt", false)[1],
|
||||
width = 0.6,
|
||||
height = 0.6,
|
||||
wo = {
|
||||
spell = false,
|
||||
wrap = false,
|
||||
signcolumn = "yes",
|
||||
statuscolumn = " ",
|
||||
conceallevel = 3,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
-- Setup some globals for debugging (lazy-loaded)
|
||||
_G.dd = function(...)
|
||||
Snacks.debug.inspect(...)
|
||||
end
|
||||
_G.bt = function()
|
||||
Snacks.debug.backtrace()
|
||||
end
|
||||
vim.print = _G.dd -- Override print to use snacks for `:=` command
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
13
lazyvim/.config/nvim/lua/scripts/meld_diff_fzf.sh
Executable file
13
lazyvim/.config/nvim/lua/scripts/meld_diff_fzf.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
file1=$(fzf --prompt="Select first file: " < <(find . -type f))
|
||||
[ -z "$file1" ] && echo "Aborted." && exit 1
|
||||
|
||||
file2=$(fzf --prompt="Select second file: " < <(find . -type f))
|
||||
[ -z "$file2" ] && echo "Aborted." && exit 1
|
||||
|
||||
echo "🔍 Comparing:"
|
||||
echo " 1: $file1"
|
||||
echo " 2: $file2"
|
||||
|
||||
meld "$file1" "$file2" &
|
||||
Reference in New Issue
Block a user