🚀feat!: Add astral.nvim

- Remove rootiest.nvim plugin
- Implements astral.nvim
This commit is contained in:
2024-07-26 14:06:08 -04:00
parent 994eae073b
commit a2ee0c6617
15 changed files with 291 additions and 191 deletions
-36
View File
@@ -1,42 +1,6 @@
-- -----------------------------------------------------------------------------
-- -------------------------------- AUTOCMDS -----------------------------------
-- -----------------------------------------------------------------------------
-- Autosave Colorscheme
-- When the colorscheme changes, store the name in .colorscheme
vim.api.nvim_create_autocmd("ColorScheme", {
desc = "Store colorscheme name",
callback = function()
print("colorscheme:", vim.g.colors_name)
vim.fn.writefile(
{ vim.g.colors_name },
vim.fn.stdpath("config") .. "/.colorscheme"
)
end,
})
-- Define cursor color/icon based on mode
local autocmd = vim.api.nvim_create_autocmd
autocmd({ "ModeChanged", "BufEnter" }, {
callback = function()
local current_mode = vim.fn.mode()
if current_mode == "n" then
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#8aa8f3" })
vim.fn.sign_define("smoothcursor", { text = "" })
elseif current_mode == "v" then
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#d298eb" })
vim.fn.sign_define("smoothcursor", { text = "" })
elseif current_mode == "V" then
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#d298eb" })
vim.fn.sign_define("smoothcursor", { text = "" })
elseif current_mode == "" then
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#bf616a" })
vim.fn.sign_define("smoothcursor", { text = "" })
elseif current_mode == "i" then
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#9bd482" })
vim.fn.sign_define("smoothcursor", { text = "" })
end
end,
})
-- GIT CONFLICT MARKERS
-- if there are conflicts, jump to first conflict, highlight conflict markers,
+68
View File
@@ -0,0 +1,68 @@
-- -----------------------------------------------------------------------------
-- ------------------------------- SpellCheck ----------------------------------
-- -----------------------------------------------------------------------------
-- Define dictionary autocorrections
vim.keymap.set("ia", "teh", "the")
vim.keymap.set("ia", "accomodate", "accommodate")
vim.keymap.set("ia", "acommodate", "accommodate")
vim.keymap.set("ia", "aparent", "apparent")
vim.keymap.set("ia", "aparrent", "apparent")
vim.keymap.set("ia", "apparant", "apparent")
vim.keymap.set("ia", "apparrent", "apparent")
vim.keymap.set("ia", "aquire", "acquire")
vim.keymap.set("ia", "becuase", "because")
vim.keymap.set("ia", "cauhgt", "caught")
vim.keymap.set("ia", "choosen", "chosen")
vim.keymap.set("ia", "cieling", "ceiling")
vim.keymap.set("ia", "collegue", "teammate")
vim.keymap.set("ia", "concensus", "consensus")
vim.keymap.set("ia", "contians", "contains")
vim.keymap.set("ia", "cosnt", "const")
vim.keymap.set("ia", "dervied", "derived")
vim.keymap.set("ia", "fales", "false")
vim.keymap.set("ia", "fasle", "false")
vim.keymap.set("ia", "fitler", "filter")
vim.keymap.set("ia", "flase", "false")
vim.keymap.set("ia", "foward", "forward")
vim.keymap.set("ia", "frequecy", "frequency")
vim.keymap.set("ia", "gaurantee", "guarantee")
vim.keymap.set("ia", "guaratee", "guarantee")
vim.keymap.set("ia", "heigth", "height")
vim.keymap.set("ia", "heirarchy", "hierarchy")
vim.keymap.set("ia", "inclued", "include")
vim.keymap.set("ia", "interator", "iterator")
vim.keymap.set("ia", "intput", "input")
vim.keymap.set("ia", "invliad", "invalid")
vim.keymap.set("ia", "lenght", "length")
vim.keymap.set("ia", "liasion", "liaison")
vim.keymap.set("ia", "libary", "library")
vim.keymap.set("ia", "listner", "listener")
vim.keymap.set("ia", "looses:", "loses")
vim.keymap.set("ia", "looup", "lookup")
vim.keymap.set("ia", "manefist", "manifest")
vim.keymap.set("ia", "namesapce", "namespace")
vim.keymap.set("ia", "namespcae", "namespace")
vim.keymap.set("ia", "occassion", "occasion")
vim.keymap.set("ia", "occured", "occurred")
vim.keymap.set("ia", "ouptut", "output")
vim.keymap.set("ia", "ouput", "output")
vim.keymap.set("ia", "overide", "override")
vim.keymap.set("ia", "postion", "position")
vim.keymap.set("ia", "priviledge", "privilege")
vim.keymap.set("ia", "psuedo", "pseudo")
vim.keymap.set("ia", "recieve", "receive")
vim.keymap.set("ia", "refered", "referred")
vim.keymap.set("ia", "relevent", "relevant")
vim.keymap.set("ia", "retreive", "retrieve")
vim.keymap.set("ia", "sloder", "solder")
vim.keymap.set("ia", "sheild", "shield")
vim.keymap.set("ia", "garbarge", "garbage")
vim.keymap.set("ia", "oposite", "opposite")
vim.keymap.set("ia", "oportunity", "opportunity")
vim.keymap.set("ia", "retreive", "retrieve")
vim.keymap.set("ia", "vegitarien", "vegetarian")
vim.keymap.set("ia", "vegatarian", "vegetarian")
vim.keymap.set("ia", "vegeterian", "vegetarian")
vim.keymap.set("ia", "vegatarien", "vegetarian")
vim.keymap.set("ia", "vegeterien", "vegetarian")
+1 -1
View File
@@ -8,7 +8,7 @@ local substitute_loaded, substitute = pcall(require, "substitute")
local codesnap_loaded = pcall(require, "codesnap")
local icon_picker_loaded = pcall(require, "icon-picker")
local gist_loaded = pcall(require, "gist")
local rootiest = require("rootiest")
local rootiest = require("config.rootiest")
local wk = require("which-key")
wk.add({
-1
View File
@@ -20,7 +20,6 @@ vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
require("lazy").setup({
spec = {
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ import = "config.rootiest" }, -- Rootiest Plugin
{ import = "plugins" }, -- General Plugins
},
defaults = { lazy = false, version = false },
+45
View File
@@ -0,0 +1,45 @@
-- -----------------------------------------------------------------------------
-- --------------------------------- NEOVIDE -----------------------------------
-- -----------------------------------------------------------------------------
-- Set GUI font
vim.opt.guifont = "Iosevka:#e-subpixelantialias:h12"
-- refresh rate and translucency
vim.g.neovide_refresh_rate = 170
vim.g.neovide_transparency = 0.85
vim.g.neovide_window_blurred = true
-- cursor fx
vim.g.neovide_cursor_vfx_mode = "railgun"
vim.g.neovide_cursor_smooth_blink = true
vim.g.neovide_cursor_vfx_particle_density = 16.0
vim.g.neovide_cursor_vfx_particle_lifetime = 1.6
vim.g.neovide_cursor_vfx_particle_phase = 1.2
vim.g.neovide_cursor_vfx_particle_curl = 1.0
vim.g.neovide_cursor_animation_length = 0.13
vim.g.neovide_cursor_trail_size = 0.8
-- floating shadow
vim.g.neovide_floating_shadow = true
vim.g.neovide_floating_z_height = 10
vim.g.neovide_light_angle_degrees = 45
vim.g.neovide_light_radius = 5
-- scaling
vim.g.neovide_scale_factor = 1.0
-- padding
vim.g.neovide_padding_top = 0
vim.g.neovide_padding_bottom = 0
vim.g.neovide_padding_right = 0
vim.g.neovide_padding_left = 0
-- Simulate kitty copy-and-paste from system clipboard
-- in normal mode
vim.cmd(":nnoremap <silent> <C-v> :r !xsel -b<cr>")
vim.cmd(":nnoremap <silent> <C-c> :w !xsel -i -b<cr>")
-- and in visual mode
vim.cmd(":vnoremap <silent> <C-v> :r !xsel -b<cr>")
vim.cmd(":vnoremap <silent> <C-c> :w !xsel -i -b<cr>")
-- and in command mode
vim.cmd(":cnoremap <silent> <C-v> <C-r>+")
vim.cmd(":cnoremap <silent> <C-c> <C-r>+")
-- and in insert mode
vim.cmd(":inoremap <silent> <C-v> <C-r>+")
vim.cmd(":inoremap <silent> <C-c> <C-r>+")
+6
View File
@@ -7,3 +7,9 @@
vim.g.loaded_perl_provider = 0
-- Prefer basedpyright
vim.g.lazyvim_python_lsp = "basedpyright"
-- --------------------------------- ROOTIEST -----------------------------------
vim.g.aitool = "codeium"
vim.g.usewakatime = true
vim.g.usehardtime = false
vim.g.useimage = true
vim.o.background = "dark"
+130 -4
View File
@@ -1,4 +1,130 @@
return {
"rootiest/rootiest.nvim",
config = true,
}
local M = {}
local precog_first_time = true
-- Yank line without leading/trailing whitespace
function M.yank_line()
vim.api.nvim_feedkeys("_v$hy$", "n", true)
end
-- Check if the terminal is Kitty
function M.using_kitty()
local term = os.getenv("TERM") or ""
return term:find("kitty") ~= nil
end
-- Toggle the precognition plugin
function M.toggle_precognition()
if pcall(require, "precognition") then
local precognition = require("precognition")
if precog_first_time then
precognition.toggle()
precognition.toggle() -- Call toggle twice
precog_first_time = false
else
precognition.toggle() -- Call toggle once
end
else
vim.api.nvim_err_writeln("precognition plugin is not installed")
end
end
-- Toggle Hardtime and Precognition
function M.toggle_hardmode()
if pcall(require, "hardtime") then
local hardtime = require("hardtime")
hardtime.toggle()
M.toggle_precognition()
else
vim.api.nvim_err_writeln("hardtime plugin is not installed")
end
end
-- Toggle LazyGit terminal
function M.toggle_lazygit_term()
if pcall(require, "toggleterm.terminal") then
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
lazygit:toggle()
else
vim.api.nvim_err_writeln("toggleterm plugin is not installed")
end
end
-- Load remote-nvim plugin
function M.load_remote()
if pcall(require, "remote-nvim") then
---@diagnostic disable-next-line: missing-parameter
require("remote-nvim").setup()
vim.cmd("RemoteStart")
else
vim.api.nvim_err_writeln("remote-nvim plugin is not installed")
end
end
-- Set cursor icons
function M.set_cursor_icons()
vim.fn.sign_define("smoothcursor_n", { text = "" })
vim.fn.sign_define("smoothcursor_v", { text = "" })
vim.fn.sign_define("smoothcursor_V", { text = "" })
vim.fn.sign_define("smoothcursor_i", { text = "" })
vim.fn.sign_define("smoothcursor_c", { text = "" })
vim.fn.sign_define("smoothcursor_R", { text = "󰊄" })
end
-- Evaluate dependencies and print warnings if needed
function M.eval_dependencies()
local function should_suppress_warnings()
return false
end
local function check_executable(executable)
if vim.fn.executable(executable) ~= 1 then
vim.api.nvim_notify(
executable .. " is not installed!",
vim.log.levels.WARN,
{}
)
end
end
if not should_suppress_warnings() then
local executables =
{ "lazygit", "gh", "rg", "fzf", "fd", "git", "luarocks" }
for _, executable in ipairs(executables) do
check_executable(executable)
end
end
end
-- Evaluate Neovide settings
function M.eval_neovide()
if vim.g.neovide then
require("config.neovide")
end
end
-- Define autocorrections
function M.define_autocorrections()
require("config.autospell")
end
-- Define user commands
function M.define_commands()
vim.api.nvim_create_user_command("Q", function()
vim.cmd.qall()
end, { force = true, desc = "Close all buffers" })
vim.api.nvim_create_user_command("YankLine", function()
M.yank_line()
end, { force = true, desc = "Yank line without leading whitespace" })
end
function M.setup()
M.eval_dependencies()
M.eval_neovide()
M.define_autocorrections()
M.define_commands()
end
return M