fix: ensure single quotes are used consistently across configuration files
This commit is contained in:
+24
-24
@@ -7,47 +7,47 @@ local autogrp = vim.api.nvim_create_augroup
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
-- LazyGit root detection
|
||||
if pcall(require, "lazygit.utils") then
|
||||
autocmd("BufEnter", {
|
||||
pattern = "*",
|
||||
if pcall(require, 'lazygit.utils') then
|
||||
autocmd('BufEnter', {
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
require("lazygit.utils").project_root_dir()
|
||||
require('lazygit.utils').project_root_dir()
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━ Set up Qalc keymappings ━━━━━━━━━━━━━━━━━━━━━━━
|
||||
if pcall(require, "qalc") then
|
||||
if pcall(require, 'qalc') then
|
||||
-- Create a group for filetype-specific mappings
|
||||
autogrp("QalcFileTypeMappings", { clear = true })
|
||||
autogrp('QalcFileTypeMappings', { clear = true })
|
||||
|
||||
-- Create an autocommand for the qalc filetype
|
||||
autocmd("FileType", {
|
||||
pattern = "qalc",
|
||||
group = "QalcFileTypeMappings",
|
||||
autocmd('FileType', {
|
||||
pattern = 'qalc',
|
||||
group = 'QalcFileTypeMappings',
|
||||
callback = function()
|
||||
-- Set the key mapping: 'y' to run the :QalcYank command in normal mode
|
||||
vim.keymap.set( -- Yank Result
|
||||
"n",
|
||||
"y",
|
||||
":QalcYank +<CR>",
|
||||
'n',
|
||||
'y',
|
||||
':QalcYank +<CR>',
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
-- Set the key mapping: 'q' to run the :QalcClose command in normal mode
|
||||
vim.keymap.set( -- Close Qalc
|
||||
"n",
|
||||
"q",
|
||||
":QalcClose<CR>",
|
||||
'n',
|
||||
'q',
|
||||
':QalcClose<CR>',
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
end,
|
||||
})
|
||||
|
||||
-- Define a custom command to close the Qalc buffer
|
||||
vim.api.nvim_create_user_command("QalcClose", function()
|
||||
vim.api.nvim_create_user_command('QalcClose', function()
|
||||
local buf_name = vim.api.nvim_buf_get_name(0)
|
||||
if buf_name ~= "" then
|
||||
vim.cmd("bd!")
|
||||
if buf_name ~= '' then
|
||||
vim.cmd('bd!')
|
||||
else
|
||||
-- If the buffer has no name, just remove it without invoking :bd!
|
||||
vim.api.nvim_buf_delete(0, { force = true })
|
||||
@@ -56,19 +56,19 @@ if pcall(require, "qalc") then
|
||||
end
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━ Set up highlights ━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
local load_highlight = require("utils.highlight")
|
||||
local load_highlight = require('utils.highlight')
|
||||
load_highlight.setup_autocommands()
|
||||
load_highlight.setup_dashboard_highlight()
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━ Set up cpp picker ━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Adds a keymap for quicker picking when in cpp files
|
||||
require("data.autocmd").cpp_picker()
|
||||
require('data.autocmd').cpp_picker()
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━ Set up nvim_exec ━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
-- Function to check and execute the NVIM_EXEC environment variable
|
||||
local function execute_nvim_exec()
|
||||
local exec_command = os.getenv("NVIM_EXEC")
|
||||
local exec_command = os.getenv('NVIM_EXEC')
|
||||
|
||||
-- If NVIM_EXEC is set, execute the command
|
||||
if exec_command then
|
||||
@@ -77,9 +77,9 @@ local function execute_nvim_exec()
|
||||
end
|
||||
|
||||
-- Define an autogroup for the autocmd
|
||||
autogrp("NvimExec", { clear = true })
|
||||
autogrp('NvimExec', { clear = true })
|
||||
-- Define an autocmd to run the function at startup
|
||||
autocmd("VimEnter", {
|
||||
group = "NvimExec",
|
||||
autocmd('VimEnter', {
|
||||
group = 'NvimExec',
|
||||
callback = execute_nvim_exec,
|
||||
})
|
||||
|
||||
+12
-12
@@ -10,49 +10,49 @@
|
||||
-- be defined in a single central location
|
||||
|
||||
-- Add keymapper function
|
||||
local add_keymap = require("data.func").add_keymap
|
||||
local add_keymap = require('data.func').add_keymap
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━ Group Keybinds ━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Add keymaps for menu groups
|
||||
for _, item in ipairs(require("data.keys").groups) do
|
||||
for _, item in ipairs(require('data.keys').groups) do
|
||||
add_keymap(item)
|
||||
end
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━ General Keybinds ━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Add keymaps for miscellaneous keybinds
|
||||
for _, item in ipairs(require("data.keys").misc) do
|
||||
for _, item in ipairs(require('data.keys').misc) do
|
||||
add_keymap(item)
|
||||
end
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━ Telescope Keybinds ━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Add keymaps for telescope symbols
|
||||
for _, item in ipairs(require("data.keys").telescope.symbols) do
|
||||
for _, item in ipairs(require('data.keys').telescope.symbols) do
|
||||
add_keymap(item)
|
||||
end
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━ Resizing splits ━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Add keymaps for resizing splits
|
||||
for _, map in ipairs(require("data.keys").splits.resize) do
|
||||
add_keymap(map[1], map[2], map[3], require("data.types").all_modes)
|
||||
for _, map in ipairs(require('data.keys').splits.resize) do
|
||||
add_keymap(map[1], map[2], map[3], require('data.types').all_modes)
|
||||
end
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━ Moving between splits ━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Add keymaps for moving between splits
|
||||
for _, map in ipairs(require("data.keys").splits.move) do
|
||||
add_keymap(map[1], map[2], map[3], require("data.types").all_modes)
|
||||
for _, map in ipairs(require('data.keys').splits.move) do
|
||||
add_keymap(map[1], map[2], map[3], require('data.types').all_modes)
|
||||
end
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━ Swapping buffers between windows ━━━━━━━━━━━━━━━
|
||||
-- Add keymaps for swapping buffers
|
||||
for _, map in ipairs(require("data.keys").splits.swap) do
|
||||
add_keymap(map[1], map[2], map[3], require("data.types").all_modes)
|
||||
for _, map in ipairs(require('data.keys').splits.swap) do
|
||||
add_keymap(map[1], map[2], map[3], require('data.types').all_modes)
|
||||
end
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ MultiCursor ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Add keymaps for multicursor
|
||||
for _, item in ipairs(require("data.keys").multicursor) do
|
||||
for _, item in ipairs(require('data.keys').multicursor) do
|
||||
add_keymap(item)
|
||||
end
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Overrides ━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
require("config.overrides")
|
||||
require('config.overrides')
|
||||
|
||||
+14
-13
@@ -4,7 +4,7 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Lazy │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||
if not vim.uv.fs_stat(lazypath) then
|
||||
-- stylua: ignore
|
||||
vim.fn.system({
|
||||
@@ -21,27 +21,28 @@ vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||
|
||||
local plugin_specs = {
|
||||
{
|
||||
"LazyVim/LazyVim", -- LazyVim
|
||||
import = "lazyvim.plugins", -- LazyVim Core Plugins
|
||||
'LazyVim/LazyVim', -- LazyVim
|
||||
import = 'lazyvim.plugins', -- LazyVim Core Plugins
|
||||
},
|
||||
{ -- VSCode
|
||||
import = "lazyvim.plugins.extras.vscode",
|
||||
import = 'lazyvim.plugins.extras.vscode',
|
||||
},
|
||||
{ import = "plugins" }, -- General Plugins
|
||||
{ import = 'plugins' }, -- General Plugins
|
||||
}
|
||||
|
||||
-- Automatically import all subdirectories of `lua/plugins`
|
||||
local plugin_dirs = vim.fn.glob("~/.config/nvim/lua/plugins/*", true, true)
|
||||
local plugin_dirs = vim.fn.glob('~/.config/nvim/lua/plugins/*', true, true)
|
||||
for _, dir in ipairs(plugin_dirs) do
|
||||
if vim.fn.isdirectory(dir) == 1 then
|
||||
table.insert( -- Add directory to the plugin import table
|
||||
plugin_specs,
|
||||
{ import = "plugins." .. vim.fn.fnamemodify(dir, ":t") }
|
||||
{ import = 'plugins.' .. vim.fn.fnamemodify(dir, ':t') }
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
require("lazy").setup({
|
||||
-- Initialize Lazy plugin manager
|
||||
require('lazy').setup({
|
||||
spec = plugin_specs,
|
||||
rocks = {
|
||||
hererocks = true,
|
||||
@@ -52,12 +53,12 @@ require("lazy").setup({
|
||||
},
|
||||
install = {
|
||||
missing = true,
|
||||
colorscheme = { "catppuccin-mocha", "tokyonight", "default" },
|
||||
colorscheme = { 'catppuccin-mocha', 'tokyonight', 'default' },
|
||||
},
|
||||
defaults = {
|
||||
lazy = true,
|
||||
version = nil,
|
||||
event = "VeryLazy",
|
||||
event = 'VeryLazy',
|
||||
},
|
||||
checker = {
|
||||
-- automatically check for plugin updates
|
||||
@@ -78,7 +79,7 @@ require("lazy").setup({
|
||||
reset_packpath = true,
|
||||
rtp = {
|
||||
reset = true, -- reset the runtime path to $VIMRUNTIME and your config directory
|
||||
disabled_plugins = require("data.types").lazy.disabled_plugins,
|
||||
disabled_plugins = require('data.types').lazy.disabled_plugins,
|
||||
},
|
||||
},
|
||||
profiling = {
|
||||
@@ -86,7 +87,7 @@ require("lazy").setup({
|
||||
require = true,
|
||||
},
|
||||
ui = {
|
||||
border = "rounded",
|
||||
title = " Plugin Manager ",
|
||||
border = 'rounded',
|
||||
title = ' Plugin Manager ',
|
||||
},
|
||||
})
|
||||
|
||||
+27
-27
@@ -2,9 +2,9 @@
|
||||
-- │ Setup Git Signs for Mini.Files │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
|
||||
local nsMiniFiles = vim.api.nvim_create_namespace("mini_files_git")
|
||||
local nsMiniFiles = vim.api.nvim_create_namespace('mini_files_git')
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
local _, MiniFiles = pcall(require, "mini.files")
|
||||
local _, MiniFiles = pcall(require, 'mini.files')
|
||||
|
||||
-- Cache for git status
|
||||
local gitStatusCache = {}
|
||||
@@ -33,7 +33,7 @@ local function mapSymbols(status)
|
||||
-- stylua: ignore end
|
||||
}
|
||||
|
||||
local result = statusMap[status] or { symbol = "?", hlGroup = "NonText" }
|
||||
local result = statusMap[status] or { symbol = '?', hlGroup = 'NonText' }
|
||||
return result.symbol, result.hlGroup
|
||||
end
|
||||
|
||||
@@ -48,7 +48,7 @@ local function fetchGitStatus(cwd, callback)
|
||||
end
|
||||
end
|
||||
vim.system(
|
||||
{ "git", "status", "--ignored", "--porcelain" },
|
||||
{ 'git', 'status', '--ignored', '--porcelain' },
|
||||
{ text = true, cwd = cwd },
|
||||
on_exit
|
||||
)
|
||||
@@ -57,7 +57,7 @@ end
|
||||
---@param str string?
|
||||
local function escapePattern(str)
|
||||
---@diagnostic disable-next-line: need-check-nil
|
||||
return str:gsub("([%^%$%(%)%%%.%[%]%*%+%-%?])", "%%%1")
|
||||
return str:gsub('([%^%$%(%)%%%.%[%]%*%+%-%?])', '%%%1')
|
||||
end
|
||||
|
||||
---@param buf_id integer
|
||||
@@ -66,10 +66,10 @@ end
|
||||
local function updateMiniWithGit(buf_id, gitStatusMap)
|
||||
vim.schedule(function()
|
||||
local nlines = vim.api.nvim_buf_line_count(buf_id)
|
||||
local cwd = vim.fs.root(buf_id, ".git")
|
||||
local cwd = vim.fs.root(buf_id, '.git')
|
||||
local escapedcwd = escapePattern(cwd)
|
||||
if vim.fn.has("win32") == 1 then
|
||||
escapedcwd = escapedcwd:gsub("\\", "/")
|
||||
if vim.fn.has('win32') == 1 then
|
||||
escapedcwd = escapedcwd:gsub('\\', '/')
|
||||
end
|
||||
|
||||
for i = 1, nlines do
|
||||
@@ -77,7 +77,7 @@ local function updateMiniWithGit(buf_id, gitStatusMap)
|
||||
if not entry then
|
||||
break
|
||||
end
|
||||
local relativePath = entry.path:gsub("^" .. escapedcwd .. "/", "")
|
||||
local relativePath = entry.path:gsub('^' .. escapedcwd .. '/', '')
|
||||
local status = gitStatusMap[relativePath]
|
||||
|
||||
if status then
|
||||
@@ -99,19 +99,19 @@ end
|
||||
local function parseGitStatus(content)
|
||||
local gitStatusMap = {}
|
||||
-- lua match is faster than vim.split (in my experience )
|
||||
for line in content:gmatch("[^\r\n]+") do
|
||||
local status, filePath = string.match(line, "^(..)%s+(.*)")
|
||||
for line in content:gmatch('[^\r\n]+') do
|
||||
local status, filePath = string.match(line, '^(..)%s+(.*)')
|
||||
-- Split the file path into parts
|
||||
local parts = {}
|
||||
for part in filePath:gmatch("[^/]+") do
|
||||
for part in filePath:gmatch('[^/]+') do
|
||||
table.insert(parts, part)
|
||||
end
|
||||
-- Start with the root directory
|
||||
local currentKey = ""
|
||||
local currentKey = ''
|
||||
for i, part in ipairs(parts) do
|
||||
if i > 1 then
|
||||
-- Concatenate parts with a separator to create a unique key
|
||||
currentKey = currentKey .. "/" .. part
|
||||
currentKey = currentKey .. '/' .. part
|
||||
else
|
||||
currentKey = part
|
||||
end
|
||||
@@ -133,11 +133,11 @@ end
|
||||
---@return nil
|
||||
local function updateGitStatus(buf_id)
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
if not vim.fs.root(vim.uv.cwd(), ".git") then
|
||||
if not vim.fs.root(vim.uv.cwd(), '.git') then
|
||||
return
|
||||
end
|
||||
|
||||
local cwd = vim.fn.expand("%:p:h")
|
||||
local cwd = vim.fn.expand('%:p:h')
|
||||
local currentTime = os.time()
|
||||
if
|
||||
gitStatusCache[cwd]
|
||||
@@ -162,12 +162,12 @@ local function clearCache()
|
||||
end
|
||||
|
||||
local function augroup(name)
|
||||
return vim.api.nvim_create_augroup("MiniFiles_" .. name, { clear = true })
|
||||
return vim.api.nvim_create_augroup('MiniFiles_' .. name, { clear = true })
|
||||
end
|
||||
|
||||
autocmd("User", {
|
||||
group = augroup("start"),
|
||||
pattern = "MiniFilesExplorerOpen",
|
||||
autocmd('User', {
|
||||
group = augroup('start'),
|
||||
pattern = 'MiniFilesExplorerOpen',
|
||||
-- pattern = { "minifiles" },
|
||||
callback = function()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
@@ -175,20 +175,20 @@ autocmd("User", {
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd("User", {
|
||||
group = augroup("close"),
|
||||
pattern = "MiniFilesExplorerClose",
|
||||
autocmd('User', {
|
||||
group = augroup('close'),
|
||||
pattern = 'MiniFilesExplorerClose',
|
||||
callback = function()
|
||||
clearCache()
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd("User", {
|
||||
group = augroup("update"),
|
||||
pattern = "MiniFilesBufferUpdate",
|
||||
autocmd('User', {
|
||||
group = augroup('update'),
|
||||
pattern = 'MiniFilesBufferUpdate',
|
||||
callback = function(sii)
|
||||
local bufnr = sii.data.buf_id
|
||||
local cwd = vim.fn.expand("%:p:h")
|
||||
local cwd = vim.fn.expand('%:p:h')
|
||||
if gitStatusCache[cwd] then
|
||||
updateMiniWithGit(bufnr, gitStatusCache[cwd].statusMap)
|
||||
end
|
||||
|
||||
+14
-13
@@ -3,14 +3,15 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Neovide │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
|
||||
-- Set GUI font
|
||||
vim.opt.guifont = "Iosevka Rootiest V2:#e-subpixelantialias:h12"
|
||||
vim.opt.guifont = 'Iosevka Rootiest V2:#e-subpixelantialias:h12'
|
||||
-- refresh rate and translucency
|
||||
vim.g.neovide_refresh_rate = 120
|
||||
vim.g.neovide_transparency = 0.85
|
||||
vim.g.neovide_window_blurred = true
|
||||
-- cursor fx
|
||||
vim.g.neovide_cursor_vfx_mode = "pixiedust"
|
||||
vim.g.neovide_cursor_vfx_mode = 'pixiedust'
|
||||
vim.g.neovide_cursor_smooth_blink = true
|
||||
vim.g.neovide_cursor_vfx_particle_density = 16.0
|
||||
vim.g.neovide_cursor_vfx_particle_lifetime = 2.1
|
||||
@@ -35,26 +36,26 @@ vim.g.neovide_padding_left = 0
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━ Clipboard mappings ━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
local modes = { "n", "v", "c", "i" }
|
||||
local modes = { 'n', 'v', 'c', 'i' }
|
||||
|
||||
-- System clipboard mappings
|
||||
for _, mode in ipairs(modes) do
|
||||
if mode == "c" or mode == "i" then
|
||||
vim.keymap.set(mode, "<C-v>", "<C-r>+", { silent = true })
|
||||
vim.keymap.set(mode, "<C-c>", "<C-r>+", { silent = true })
|
||||
if mode == 'c' or mode == 'i' then
|
||||
vim.keymap.set(mode, '<C-v>', '<C-r>+', { silent = true })
|
||||
vim.keymap.set(mode, '<C-c>', '<C-r>+', { silent = true })
|
||||
else
|
||||
vim.keymap.set(mode, "<C-v>", ":r !xsel -b<CR>", { silent = true })
|
||||
vim.keymap.set(mode, "<C-c>", ":w !xsel -i -b<CR>", { silent = true })
|
||||
vim.keymap.set(mode, '<C-v>', ':r !xsel -b<CR>', { silent = true })
|
||||
vim.keymap.set(mode, '<C-c>', ':w !xsel -i -b<CR>', { silent = true })
|
||||
end
|
||||
end
|
||||
|
||||
-- Wezterm-style clipboard mappings (Control-Shift)
|
||||
for _, mode in ipairs(modes) do
|
||||
if mode == "c" or mode == "i" then
|
||||
vim.keymap.set(mode, "<C-S-v>", "<C-r>+", { silent = true })
|
||||
vim.keymap.set(mode, "<C-S-c>", "<C-r>+", { silent = true })
|
||||
if mode == 'c' or mode == 'i' then
|
||||
vim.keymap.set(mode, '<C-S-v>', '<C-r>+', { silent = true })
|
||||
vim.keymap.set(mode, '<C-S-c>', '<C-r>+', { silent = true })
|
||||
else
|
||||
vim.keymap.set(mode, "<C-S-v>", ":r !xsel -b<CR>", { silent = true })
|
||||
vim.keymap.set(mode, "<C-S-c>", ":w !xsel -i -b<CR>", { silent = true })
|
||||
vim.keymap.set(mode, '<C-S-v>', ':r !xsel -b<CR>', { silent = true })
|
||||
vim.keymap.set(mode, '<C-S-c>', ':w !xsel -i -b<CR>', { silent = true })
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Neovim Updater Debug Functions │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
|
||||
local D = {}
|
||||
|
||||
-- local P = require("nvim_updater")
|
||||
local U = require('nvim_updater.utils')
|
||||
|
||||
function D.test_floating_window()
|
||||
local output = U.run_hidden_command(
|
||||
"cd ~/.local/src/neovim && git --no-pager log --pretty=format:'%s' HEAD..origin/master"
|
||||
)
|
||||
U.draw_floating_window(output)
|
||||
end
|
||||
|
||||
return D
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ KEYS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
vim.opt.foldlevel = 99
|
||||
|
||||
-- Set the mapleader variable to the space key
|
||||
vim.g.mapleader = " " ---@type string Options: <leader>
|
||||
|
||||
@@ -68,7 +70,7 @@ vim.g.usetodo = false ---@type boolean Options: <true|
|
||||
-- Use experimental cmp performance fork
|
||||
vim.g.cmp_performance_enabled = true ---@type boolean Options: <true|false>
|
||||
-- Use dev mode for rootiest plugins
|
||||
vim.g.rootiest_dev = false ---@type boolean Options: <true|false>
|
||||
vim.g.rootiest_dev = true ---@type boolean Options: <true|false>
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ PICKER ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
@@ -105,6 +107,9 @@ vim.g.useavante = true ---@type boolean Options: <true
|
||||
-- Enable GP plugin for AI chat
|
||||
vim.g.usegpai = false ---@type boolean Options: <true|false>
|
||||
|
||||
----- Use Blink instead of nvim-cmp -----
|
||||
vim.g.useblinkcmp = true ---@type boolean Options: <true|false>
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STATUS COLUMN ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
vim.g.statuscolumn = "native" ---@type string Options: [statuscolumn]
|
||||
|
||||
@@ -5,33 +5,33 @@
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━ Keymap Overrides ━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
-- Add keymapper function
|
||||
local add_keymap = require("data.func").add_keymap
|
||||
local add_keymap = require('data.func').add_keymap
|
||||
|
||||
-- Add keymaps for overrides
|
||||
add_keymap(require("data.keys").overrides)
|
||||
add_keymap(require('data.keys').overrides)
|
||||
|
||||
-- Replace '...' with '…' (ellipsis) on InsertLeave
|
||||
require("data.func").setup_replace_ellipsis(true)
|
||||
require('data.func').setup_replace_ellipsis(true)
|
||||
|
||||
-- Search selected text in visual mode
|
||||
add_keymap("/", "*<Esc>", "Search selected text", "v")
|
||||
add_keymap('/', '*<Esc>', 'Search selected text', 'v')
|
||||
|
||||
-- Use modern cipher instead of rot13
|
||||
add_keymap(require("data.keys").cipher.hex)
|
||||
add_keymap(require('data.keys').cipher.hex)
|
||||
|
||||
-- Help keybinds
|
||||
for _, item in ipairs(require("data.keys").help) do
|
||||
for _, item in ipairs(require('data.keys').help) do
|
||||
add_keymap(item)
|
||||
end
|
||||
|
||||
-- Remap Command Mode List
|
||||
require("data.keys").cmd_mode()
|
||||
require('data.keys').cmd_mode()
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━ Additional Overrides ━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
if vim.g.is_termux then
|
||||
if require("data.func").is_installed("neominimap") then
|
||||
if require('data.func').is_installed('neominimap') then
|
||||
-- Disable NeoMiniMap
|
||||
vim.cmd("Neominimap off")
|
||||
vim.cmd('Neominimap off')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━ Post-Config Functions ━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
-- Setup blinky cursor
|
||||
require("utils.blinky").setup(vim.g.blinky)
|
||||
require('utils.blinky').setup(vim.g.blinky)
|
||||
|
||||
-- Setup nvim-remote
|
||||
if vim.fn.executable("nvr") == 1 then
|
||||
if vim.fn.executable('nvr') == 1 then
|
||||
vim.env.GIT_EDITOR = "nvr -cc split --remote-wait +'set bufhidden=wipe'"
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ local prefix = vim.env.PREFIX
|
||||
|
||||
-- Check if prefix contains "com.termux"
|
||||
if prefix ~= nil then
|
||||
if prefix:match("com.termux") then
|
||||
if prefix:match('com.termux') then
|
||||
vim.g.useimage = false
|
||||
vim.g.is_termux = true
|
||||
end
|
||||
|
||||
+16
-16
@@ -12,32 +12,32 @@
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
|
||||
-- Check if the environment variable is set
|
||||
local should_profile = os.getenv("NVIM_PROFILE")
|
||||
local profile_module = os.getenv("NVIM_PROFILE_MODULE") or "*"
|
||||
local should_profile = os.getenv('NVIM_PROFILE')
|
||||
local profile_module = os.getenv('NVIM_PROFILE_MODULE') or '*'
|
||||
|
||||
-- Start the profiler
|
||||
if should_profile then
|
||||
require("profile").instrument_autocmds()
|
||||
if should_profile:lower():match("^start") then
|
||||
require("profile").start(profile_module)
|
||||
require('profile').instrument_autocmds()
|
||||
if should_profile:lower():match('^start') then
|
||||
require('profile').start(profile_module)
|
||||
else
|
||||
require("profile").instrument(profile_module)
|
||||
require('profile').instrument(profile_module)
|
||||
end
|
||||
end
|
||||
|
||||
-- Function to toggle the profiler
|
||||
local function toggle_profile()
|
||||
local prof = require("profile")
|
||||
local prof = require('profile')
|
||||
if prof.is_recording() then
|
||||
prof.stop()
|
||||
vim.ui.input({
|
||||
prompt = "Save profile to:",
|
||||
completion = "file",
|
||||
default = "profile.json",
|
||||
prompt = 'Save profile to:',
|
||||
completion = 'file',
|
||||
default = 'profile.json',
|
||||
}, function(filename)
|
||||
if filename then
|
||||
prof.export(filename)
|
||||
vim.notify(string.format("Wrote %s", filename))
|
||||
vim.notify(string.format('Wrote %s', filename))
|
||||
end
|
||||
end)
|
||||
else
|
||||
@@ -46,11 +46,11 @@ local function toggle_profile()
|
||||
end
|
||||
|
||||
-- Add the keybind to toggle the profiler
|
||||
require("data").func.add_keymap("<leader>d<f1>", function()
|
||||
require('data').func.add_keymap('<leader>d<f1>', function()
|
||||
local prof_name = profile_module
|
||||
if profile_module == "*" then
|
||||
prof_name = "all"
|
||||
if profile_module == '*' then
|
||||
prof_name = 'all'
|
||||
end
|
||||
print("Profiling module: " .. prof_name)
|
||||
print('Profiling module: ' .. prof_name)
|
||||
toggle_profile()
|
||||
end, "Toggle Profiler")
|
||||
end, 'Toggle Profiler')
|
||||
|
||||
+41
-41
@@ -10,66 +10,66 @@ local M = {}
|
||||
function M.bootstrap()
|
||||
do
|
||||
local rocks_config = {
|
||||
rocks_path = vim.env.HOME .. "/.local/share/nvim/rocks",
|
||||
rocks_path = vim.env.HOME .. '/.local/share/nvim/rocks',
|
||||
}
|
||||
|
||||
vim.g.rocks_nvim = rocks_config
|
||||
|
||||
local luarocks_path = {
|
||||
vim.fs.joinpath(rocks_config.rocks_path, "share", "lua", "5.1", "?.lua"),
|
||||
vim.fs.joinpath(rocks_config.rocks_path, 'share', 'lua', '5.1', '?.lua'),
|
||||
vim.fs.joinpath(
|
||||
rocks_config.rocks_path,
|
||||
"share",
|
||||
"lua",
|
||||
"5.1",
|
||||
"?",
|
||||
"init.lua"
|
||||
'share',
|
||||
'lua',
|
||||
'5.1',
|
||||
'?',
|
||||
'init.lua'
|
||||
),
|
||||
}
|
||||
package.path = package.path .. ";" .. table.concat(luarocks_path, ";")
|
||||
package.path = package.path .. ';' .. table.concat(luarocks_path, ';')
|
||||
|
||||
local luarocks_cpath = {
|
||||
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.so"),
|
||||
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.so"),
|
||||
vim.fs.joinpath(rocks_config.rocks_path, 'lib', 'lua', '5.1', '?.so'),
|
||||
vim.fs.joinpath(rocks_config.rocks_path, 'lib64', 'lua', '5.1', '?.so'),
|
||||
-- Remove the dylib and dll paths if you do not need macos or windows support
|
||||
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.dylib"),
|
||||
vim.fs.joinpath(rocks_config.rocks_path, 'lib', 'lua', '5.1', '?.dylib'),
|
||||
vim.fs.joinpath(
|
||||
rocks_config.rocks_path,
|
||||
"lib64",
|
||||
"lua",
|
||||
"5.1",
|
||||
"?.dylib"
|
||||
'lib64',
|
||||
'lua',
|
||||
'5.1',
|
||||
'?.dylib'
|
||||
),
|
||||
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.dll"),
|
||||
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.dll"),
|
||||
vim.fs.joinpath(rocks_config.rocks_path, 'lib', 'lua', '5.1', '?.dll'),
|
||||
vim.fs.joinpath(rocks_config.rocks_path, 'lib64', 'lua', '5.1', '?.dll'),
|
||||
}
|
||||
package.cpath = package.cpath .. ";" .. table.concat(luarocks_cpath, ";")
|
||||
package.cpath = package.cpath .. ';' .. table.concat(luarocks_cpath, ';')
|
||||
|
||||
vim.opt.runtimepath:append(
|
||||
vim.fs.joinpath(
|
||||
rocks_config.rocks_path,
|
||||
"lib",
|
||||
"luarocks",
|
||||
"rocks-5.1",
|
||||
"rocks.nvim",
|
||||
"*"
|
||||
'lib',
|
||||
'luarocks',
|
||||
'rocks-5.1',
|
||||
'rocks.nvim',
|
||||
'*'
|
||||
)
|
||||
)
|
||||
end
|
||||
|
||||
-- If rocks.nvim is not installed then install it!
|
||||
if not pcall(require, "rocks") then
|
||||
if not pcall(require, 'rocks') then
|
||||
local rocks_location =
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
vim.fs.joinpath(vim.fn.stdpath("cache"), "rocks.nvim")
|
||||
vim.fs.joinpath(vim.fn.stdpath('cache'), 'rocks.nvim')
|
||||
|
||||
if not vim.uv.fs_stat(rocks_location) then
|
||||
-- Pull down rocks.nvim
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/nvim-neorocks/rocks.nvim",
|
||||
'git',
|
||||
'clone',
|
||||
'--filter=blob:none',
|
||||
'https://github.com/nvim-neorocks/rocks.nvim',
|
||||
rocks_location,
|
||||
})
|
||||
end
|
||||
@@ -77,24 +77,24 @@ function M.bootstrap()
|
||||
-- If the clone was successful then source the bootstrapping script
|
||||
assert(
|
||||
vim.v.shell_error == 0,
|
||||
"rocks.nvim installation failed. Try exiting and re-entering Neovim!"
|
||||
'rocks.nvim installation failed. Try exiting and re-entering Neovim!'
|
||||
)
|
||||
|
||||
vim.cmd.source(vim.fs.joinpath(rocks_location, "bootstrap.lua"))
|
||||
vim.cmd.source(vim.fs.joinpath(rocks_location, 'bootstrap.lua'))
|
||||
|
||||
vim.fn.delete(rocks_location, "rf")
|
||||
vim.fn.delete(rocks_location, 'rf')
|
||||
end
|
||||
end
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━ Ensure Luarocks ━━━━━━━━━━━━━━━━━━━━━━━
|
||||
function M.ensure_luarocks()
|
||||
-- Check if 'luarocks' command is available
|
||||
if os.execute("luarocks --version") ~= 0 then
|
||||
if os.execute('luarocks --version') ~= 0 then
|
||||
-- 'luarocks' is not installed, set up 'luarocks.nvim' plugin
|
||||
local status_ok, lazy = pcall(require, "lazy")
|
||||
local status_ok, lazy = pcall(require, 'lazy')
|
||||
if not status_ok then
|
||||
vim.notify(
|
||||
"Lazy.nvim not found. Please install it to manage plugins.",
|
||||
'Lazy.nvim not found. Please install it to manage plugins.',
|
||||
vim.log.levels.ERROR
|
||||
)
|
||||
return
|
||||
@@ -102,14 +102,14 @@ function M.ensure_luarocks()
|
||||
|
||||
lazy.setup({
|
||||
{
|
||||
"vhyrro/luarocks.nvim",
|
||||
'vhyrro/luarocks.nvim',
|
||||
priority = 1000, -- Ensure this plugin loads first
|
||||
opts = {
|
||||
rocks = { "magick" }, -- Example of a rock that you want to install
|
||||
rocks = { 'magick' }, -- Example of a rock that you want to install
|
||||
},
|
||||
config = function()
|
||||
-- Restart Neovim to apply changes after 'luarocks.nvim' sets up
|
||||
vim.cmd("source $MYVIMRC | qa")
|
||||
vim.cmd('source $MYVIMRC | qa')
|
||||
end,
|
||||
},
|
||||
})
|
||||
@@ -117,17 +117,17 @@ function M.ensure_luarocks()
|
||||
end
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━ Rocks plugin spec ━━━━━━━━━━━━━━━━━━━━━━
|
||||
M.plugin_spec = {
|
||||
"vhyrro/luarocks.nvim",
|
||||
'vhyrro/luarocks.nvim',
|
||||
priority = 1000, -- Very high priority is required
|
||||
opts = {
|
||||
rocks = { "magick" }, -- specifies a list of rocks to install
|
||||
rocks = { 'magick' }, -- specifies a list of rocks to install
|
||||
},
|
||||
}
|
||||
|
||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Load plugins ━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
-- Load rocks package manager
|
||||
M.load_rocks = function()
|
||||
require("rocks")
|
||||
require('rocks')
|
||||
end
|
||||
|
||||
-- Perform setup
|
||||
|
||||
+36
-36
@@ -10,18 +10,18 @@ local M = {}
|
||||
---@param message string The error message to trigger
|
||||
---@return boolean condition true if the error message was triggered, false otherwise
|
||||
local function trigger_error(message)
|
||||
return require("data").func.notify(message, "ERROR")
|
||||
return require('data').func.notify(message, 'ERROR')
|
||||
end
|
||||
|
||||
local function setup_os_vars()
|
||||
-- Check if we are on windows
|
||||
vim.g.is_windows = vim.fn.has("win32") == 1 or vim.fn.has("win64") == 1
|
||||
vim.g.is_windows = vim.fn.has('win32') == 1 or vim.fn.has('win64') == 1
|
||||
end
|
||||
|
||||
--- Yank line without leading/trailing whitespace
|
||||
---@return nil
|
||||
function M.yank_line()
|
||||
vim.api.nvim_feedkeys("_v$hy$", "n", true)
|
||||
vim.api.nvim_feedkeys('_v$hy$', 'n', true)
|
||||
end
|
||||
|
||||
-- Variable to track if the precognition plugin has been called once
|
||||
@@ -30,9 +30,9 @@ local precog_first_time = true
|
||||
--- Toggle the precognition plugin
|
||||
---@return nil
|
||||
function M.toggle_precognition()
|
||||
if pcall(require, "precognition") then
|
||||
if pcall(require, 'precognition') then
|
||||
-- Initialize precognition plugin
|
||||
local precognition = require("precognition")
|
||||
local precognition = require('precognition')
|
||||
-- Toggle the plugin
|
||||
if precog_first_time then
|
||||
precognition.toggle()
|
||||
@@ -42,19 +42,19 @@ function M.toggle_precognition()
|
||||
precognition.toggle() -- Call toggle once
|
||||
end
|
||||
else
|
||||
trigger_error("precognition plugin is not installed")
|
||||
trigger_error('precognition plugin is not installed')
|
||||
end
|
||||
end
|
||||
|
||||
--- Toggle Hardtime and Precognition together
|
||||
---@return nil
|
||||
function M.toggle_hardmode()
|
||||
if pcall(require, "hardtime") then
|
||||
local hardtime = require("hardtime")
|
||||
if pcall(require, 'hardtime') then
|
||||
local hardtime = require('hardtime')
|
||||
hardtime.toggle()
|
||||
M.toggle_precognition()
|
||||
else
|
||||
trigger_error("hardtime plugin is not installed")
|
||||
trigger_error('hardtime plugin is not installed')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -63,18 +63,18 @@ end
|
||||
---@param size number|nil The size of the terminal split (default: 0.3)
|
||||
---@return boolean condition true if the terminal was toggled, false otherwise
|
||||
function M.toggle_lazygit_term(direction, size)
|
||||
if pcall(require, "toggleterm.terminal") then
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
if pcall(require, 'toggleterm.terminal') then
|
||||
local Terminal = require('toggleterm.terminal').Terminal
|
||||
local lazygit = Terminal:new({
|
||||
cmd = "lazygit",
|
||||
cmd = 'lazygit',
|
||||
hidden = true,
|
||||
direction = direction or "horizontal", -- Set direction to horizontal split
|
||||
direction = direction or 'horizontal', -- Set direction to horizontal split
|
||||
size = size or 0.3, -- Set size to 30% of the screen
|
||||
})
|
||||
lazygit:toggle()
|
||||
return true
|
||||
else
|
||||
trigger_error("toggleterm plugin is not installed")
|
||||
trigger_error('toggleterm plugin is not installed')
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -83,23 +83,23 @@ end
|
||||
---@param my_args string|nil The arguments to pass to the lazygit command (default: nil)
|
||||
---@return boolean condition true if the terminal was toggled, false otherwise
|
||||
function M.toggle_lazygit_float(my_args)
|
||||
if pcall(require, "toggleterm.terminal") then
|
||||
local Util = require("lazyvim.util")
|
||||
if pcall(require, 'toggleterm.terminal') then
|
||||
local Util = require('lazyvim.util')
|
||||
my_args = my_args or nil
|
||||
if my_args ~= "" or my_args ~= nil then
|
||||
if my_args ~= '' or my_args ~= nil then
|
||||
Util.terminal.open(
|
||||
{ "lazygit", my_args },
|
||||
{ 'lazygit', my_args },
|
||||
{ cwd = Util.root(), interactive = true, esc_esc = false }
|
||||
)
|
||||
else
|
||||
Util.terminal.open(
|
||||
{ "lazygit" },
|
||||
{ 'lazygit' },
|
||||
{ cwd = Util.root(), interactive = true, esc_esc = false }
|
||||
)
|
||||
end
|
||||
return true
|
||||
else
|
||||
trigger_error("toggleterm plugin is not installed")
|
||||
trigger_error('toggleterm plugin is not installed')
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -107,13 +107,13 @@ end
|
||||
--- Load remote-nvim plugin
|
||||
---@return boolean condition true if the plugin was loaded, false otherwise
|
||||
function M.load_remote()
|
||||
if pcall(require, "remote-nvim") then
|
||||
if pcall(require, 'remote-nvim') then
|
||||
---@diagnostic disable-next-line: missing-parameter
|
||||
require("remote-nvim").setup()
|
||||
vim.cmd("RemoteStart")
|
||||
require('remote-nvim').setup()
|
||||
vim.cmd('RemoteStart')
|
||||
return true
|
||||
else
|
||||
trigger_error("remote-nvim plugin is not installed")
|
||||
trigger_error('remote-nvim plugin is not installed')
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -122,19 +122,19 @@ end
|
||||
--- @return boolean true if any text was pasted successfully, false otherwise
|
||||
function M.YankAndPasteInQuotes()
|
||||
-- Yank text inside quotes on the current line
|
||||
vim.cmd("normal! yiq")
|
||||
vim.cmd('normal! yiq')
|
||||
|
||||
-- Get the yanked text from the "0 register (the unnamed register)
|
||||
local yanked_text = vim.fn.getreg('"')
|
||||
|
||||
-- List of marks to check ('a' to 'z')
|
||||
local marks = "abcdefghijklmnopqrstuvwxyz"
|
||||
local marks = 'abcdefghijklmnopqrstuvwxyz'
|
||||
|
||||
-- Flag to track if any pasting was successful
|
||||
local was_pasted = false
|
||||
|
||||
-- Loop through each mark
|
||||
for mark in marks:gmatch(".") do
|
||||
for mark in marks:gmatch('.') do
|
||||
-- Check if the mark exists (returns the line number or nil)
|
||||
local position = vim.fn.getpos("'" .. mark)
|
||||
|
||||
@@ -143,8 +143,8 @@ function M.YankAndPasteInQuotes()
|
||||
vim.cmd("normal! '" .. mark)
|
||||
|
||||
-- Select text inside quotes and paste the yanked text
|
||||
vim.cmd("normal! viq")
|
||||
vim.cmd('normal! "' .. yanked_text .. "P")
|
||||
vim.cmd('normal! viq')
|
||||
vim.cmd('normal! "' .. yanked_text .. 'P')
|
||||
|
||||
-- Set the flag to true since pasting was successful
|
||||
was_pasted = true
|
||||
@@ -159,7 +159,7 @@ end
|
||||
---@return boolean condition true if Neovide is active, false otherwise
|
||||
function M.eval_neovide()
|
||||
if vim.g.neovide then
|
||||
require("config.neovide")
|
||||
require('config.neovide')
|
||||
return true
|
||||
else
|
||||
return false
|
||||
@@ -170,14 +170,14 @@ end
|
||||
---@return nil
|
||||
function M.define_commands()
|
||||
-- Define Q as a usercmd
|
||||
vim.api.nvim_create_user_command("Q", "qall", { desc = "Quit all buffers" })
|
||||
vim.api.nvim_create_user_command('Q', 'qall', { desc = 'Quit all buffers' })
|
||||
|
||||
-- Define yank line command
|
||||
vim.api.nvim_create_user_command("YankLine", function()
|
||||
vim.api.nvim_create_user_command('YankLine', function()
|
||||
M.yank_line()
|
||||
end, { force = true, desc = "Yank line without leading whitespace" })
|
||||
end, { force = true, desc = 'Yank line without leading whitespace' })
|
||||
vim.api.nvim_create_user_command(
|
||||
"YankAndPasteQuotes",
|
||||
'YankAndPasteQuotes',
|
||||
M.YankAndPasteInQuotes,
|
||||
{}
|
||||
)
|
||||
@@ -190,9 +190,9 @@ function M.setup()
|
||||
M.define_commands()
|
||||
|
||||
-- Setup types data
|
||||
require("data.types").setup()
|
||||
require('data.types').setup()
|
||||
-- Setup indentor
|
||||
require("utils.indentor")
|
||||
require('utils.indentor')
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user