🧙 Implement Rootiest Module

- Major Update!!!
- Implements a rootiest module
  - Consolidates much of the settings
  - Improves usability and efficiency
- Faster Loading
- Cleaner Structure
- More keymaps and plugins now have conditional loading
This commit is contained in:
2024-07-24 13:45:52 -04:00
parent f38daf087c
commit 05670570f1
16 changed files with 618 additions and 440 deletions
+1
View File
@@ -9,3 +9,4 @@ debug/
.leader
.useimage
.wakatime
.ignore-deps
+88 -66
View File
@@ -1,5 +1,10 @@
# Rootiest NeoVim Configuration
<a href="https://dotfyle.com/rootiest/rootiest-nvim"><img src="https://dotfyle.com/rootiest/rootiest-nvim/badges/plugins?style=flat" /></a>
<a href="https://dotfyle.com/rootiest/rootiest-nvim"><img src="https://dotfyle.com/rootiest/rootiest-nvim/badges/leaderkey?style=flat" /></a>
<a href="https://dotfyle.com/rootiest/rootiest-nvim"><img src="https://dotfyle.com/rootiest/rootiest-nvim/badges/plugin-manager?style=flat" /></a>
```none
██████╗ ██████╗ ██████╗ ████████╗██╗███████╗███████╗████████╗
██╔══██╗██╔═══██╗██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝╚══██╔══╝
@@ -32,71 +37,108 @@ lllllllc ,loooooool,:ol |VVVVVVV//##/+/#/+/#/'/#/
The rootiest neovim configuration you will ever see!
## Installation
## Pre-requisites
This is the traditional method to install a NeoVim configuration.
You will need to manually install NeoVim if you do not already have it.
> Note:
> While NeoVim may run without these prerequisites,
> functionality will be limited.
> For the full experience, it is recommended to install the pre-requisites.
### Required
- [git](https://git-scm.com/) -
Version control system
- [luarocks](https://luarocks.org/) -
Lua package manager
- [Nerd Fonts](https://github.com/ryanoasis/nerd-fonts/) -
Font with extended glyphs
Your terminal/client application ***must*** have a Nerd Font installed
and support the Nerd Font glyphs.
Kitty or NeoVide are recommended.
### Optional
- [ripgrep](https://github.com/BurntSushi/ripgrep) -
A faster grep
- [fzf](https://github.com/junegunn/fzf) -
A command-line fuzzy finder
- [fd](https://github.com/sharkdp/fd) -
A simple, fast and user-friendly alternative to 'find'
- [lazygit](https://github.com/jesseduffield/lazygit) -
A simple terminal UI for git commands
- [kitty](https://sw.kovidgoyal.net/kitty/) -
A fast, feature-rich, GPU based terminal emulator
- [NeoVide](https://neovide.dev/) -
A fast, feature-rich, and modern NeoVim GUI
- [fish](https://fishshell.com/) -
A smart and user-friendly command line shell
## Installation
1. Install [NeoVim](https://github.com/neovim/neovim/blob/master/INSTALL.md) (0.9+)
2. Install Pre-requisites
- Required
- [git](https://git-scm.com/) -
Version control system
- [luarocks](https://luarocks.org/) -
Lua package manager
- A terminal that has
[Nerd Fonts](https://github.com/ryanoasis/nerd-fonts/) support
- Optional (but recommended for the full experience)
- [ripgrep](https://github.com/BurntSushi/ripgrep) -
A faster grep
- [fzf](https://github.com/junegunn/fzf) -
A command-line fuzzy finder
- [fd](https://github.com/sharkdp/fd) -
A simple, fast and user-friendly alternative to 'find'
- [lazygit](https://github.com/jesseduffield/lazygit) -
A simple terminal UI for git commands
- [tree-sitter](https://github.com/tree-sitter/tree-sitter/) -
A parser generator tool and an incremental parsing library
- [kitty](https://sw.kovidgoyal.net/kitty/) -
A fast, feature-rich, GPU based terminal emulator
- [NeoVide](https://neovide.dev/) -
A fast, feature-rich, and modern NeoVim GUI
- [fish](https://fishshell.com/) -
A smart and user-friendly command line shell
3. Backup your current nvim configuration (if you have one)
```bash
```sh
mv ~/.config/nvim ~/.config/nvim.bak
```
4. Clone the repository
```bash
git clone https://github.com/rootiest/rootiest-nvim.git ~/.config/nvim
```sh
git clone git@github.com:rootiest/rootiest-nvim ~/.config/nvim
```
5. Enjoy! 🎉
## Alternative Install
## Keep your current nvim configuration
This is a more automatic method to install the Rootiest NeoVim configuration.
This method will automatically download the NeoVim AppImage if required.
It will then automatically install the Rootiest NeoVim configuration.
This will download and open the Rootiest NeoVim configuration
without replacing your current NeoVim configuration.
1. Run the install script
1. Clone the repository
```bash
curl -sL https://raw.githubusercontent.com/rootiest/rootiest-nvim/main/install.sh | bash
```
```sh
git clone git@github.com:rootiest/rootiest-nvim ~/.config/rootiest/rootiest-nvim
```
2. Install pre-requisites
2. Open Neovim with this config:
```sh
NVIM_APPNAME=rootiest/rootiest-nvim/ nvim
```
3. Enjoy! 🎉
4. Fall in love and see [Installation](#installation)
## Features
- Comfortable keybindings and IDE-like features
- Designed to be quick to load and easy to use without compromising on features
- Leans heavily on lazy and luarocks for plugin management and lazy-loading
- Catppuccin theme is default but a selection of others are also included
- Automatic light/dark mode switching based on system theme
- Extensive special configurations for kitty, including theme matching
- Kitty scrollback and keybinding support
- Special configuration for neovide
- Detects terminal client and adjusts accordingly
- ToggleTerm, fzf, telescope, neotree, etc. for quick access to files and terminal
- Many UI elements to enhance the experience
- LSP support for many languages and automatic setup for many more
- Remotely spawn a NeoVim instance over ssh, in a container, or from a git repo
- Dashboard logo adjusts to the size of the window
- Warnings for missing dependencies
- User-selected AI completion tool:
`codeium`, `copilot`, `tabnine`, `minuet`, or `none`
- WakaTime integration: Tracking time spent on code
- Hardtime integration: Trains better use of vim motions and shortcuts
- Colorscheme is remembered between sessions
- Lean and fast while providing a complete professional experience
- Achieves sub-75ms startup time on my laptop
## Options
There are some hidden files in the configuration directory that can be
@@ -126,29 +168,9 @@ used to configure user options.
This file defines whether the Hardtime plugin is enabled.
The options are `true` or `false`.
## Features
- Comfortable keybindings and IDE-like features
- Designed to be quick to load and easy to use without compromising on features
- Leans heavily on lazy and luarocks for plugin management and lazy-loading
- Catppuccin theme is default but a selection of others are also included
- Automatic light/dark mode switching based on system theme
- Extensive special configurations for kitty, including theme matching
- Kitty scrollback and keybinding support
- Special configuration for neovide
- Detects terminal client and adjusts accordingly
- ToggleTerm, fzf, telescope, neotree, etc. for quick access to files and terminal
- Many UI elements to enhance the experience
- LSP support for many languages and automatic setup for many more
- Remotely spawn a NeoVim instance over ssh, in a container, or from a git repo
- Dashboard logo adjusts to the size of the window
- User-selected AI completion tool:
`codeium`, `copilot`, `tabnine`, `minuet`, or `none`
- WakaTime integration: Tracking time spent on code
- Hardtime integration: Trains better use of vim motions and shortcuts
- Colorscheme is remembered between sessions
- Lean and fast while providing a complete professional experience
- Achieves sub-75ms startup time on my laptop
- `.ignore-deps` : **Disables dependency check**
This file defines whether the dependency check is enabled.
The options are `true` or `false`.
## Companion Tools
+4 -2
View File
@@ -51,7 +51,9 @@
-- ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
-- The rootiest NeoVim configuration!
-- ---------------------------------- LAZY -------------------------------------
-- Load Lazy package manager and plugins
require("config.lazy")
-- ---------------------------------- USER -------------------------------------
require("config.user")
-- -------------------------------- ROOTIEST -----------------------------------
-- Load the rootiest configuration
require("config.rootiest").setup()
-27
View File
@@ -1,33 +1,6 @@
-- -----------------------------------------------------------------------------
-- -------------------------------- AUTOCMDS -----------------------------------
-- -----------------------------------------------------------------------------
-- -------------------------------- Commands -----------------------------------
-- Make :Q close all of the buffers
vim.api.nvim_create_user_command("Q", function()
vim.cmd.qall()
end, { force = true, desc = "Close all buffers" })
-- Yank line without leading/trailing whitespace
vim.api.nvim_create_user_command("YankLine", function()
-- Yank line without leading/trailing whitespace
vim.api.nvim_feedkeys("_v$hy$", "n", true)
end, { force = true, desc = "Yank line without leading whitespace" })
-- Restore Colorscheme
vim.api.nvim_create_user_command("RestoreColorscheme", function()
vim.cmd.colorscheme(
STORED_THEME or KITTY_THEME or "catppuccin-frappe" or "tokyonight"
)
end, { force = true })
-- Load/start Remote
vim.api.nvim_create_user_command("LoadRemote", function()
require("remote-nvim").setup()
vim.cmd("RemoteStart")
end, { force = true, desc = "Load/start Remote" })
-- ------------------------------ Auto-Commands --------------------------------
-- Autosave Colorscheme
-- When the colorscheme changes, store the name in .colorscheme
vim.api.nvim_create_autocmd("ColorScheme", {
-48
View File
@@ -1,48 +0,0 @@
-- -----------------------------------------------------------------------------
-- ------------------------------ CHECK-FILES ----------------------------------
-- -----------------------------------------------------------------------------
----- Verify settings files exist and create them if they don't exist -----
-- -----------------------------------------------------------------------------
-- Check if the .leader file exists
if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.leader") ~= 1 then
vim.fn.writefile({ vim.g.mapleader }, vim.fn.stdpath("config") .. "/.leader")
end
-- Check if the .colorscheme file exists
if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.colorscheme") ~= 1 then
-- Use the kitty theme
if os.getenv("KITTY_THEME") then
KITTY_THEME = os.getenv("KITTY_THEME")
vim.fn.writefile(
{ KITTY_THEME },
vim.fn.stdpath("config") .. "/.colorscheme"
)
else
-- Use the default colorscheme
vim.fn.writefile(
{ vim.g.colors_name },
vim.fn.stdpath("config") .. "/.colorscheme"
)
end
end
-- Check if the .aitool file exists
if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.aitool") ~= 1 then
vim.fn.writefile({ "codeium" }, vim.fn.stdpath("config") .. "/.aitool")
end
-- Check if the .useimage file exists
if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.useimage") ~= 1 then
vim.fn.writefile({ "true" }, vim.fn.stdpath("config") .. "/.useimage")
end
-- Check if the .wakatime file exists
if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.wakatime") ~= 1 then
vim.fn.writefile({ "true" }, vim.fn.stdpath("config") .. "/.wakatime")
end
-- Check if the .hardtime file exists
if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.hardtime") ~= 1 then
vim.fn.writefile({ "false" }, vim.fn.stdpath("config") .. "/.hardtime")
end
+134 -46
View File
@@ -3,6 +3,13 @@
-- -----------------------------------------------------------------------------
-- --------------------------------- Keymaps -----------------------------------
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("config.rootiest")
local wk = require("which-key")
wk.add({
{
@@ -13,35 +20,52 @@ wk.add({
{
"<leader>gt",
rhs = function()
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
lazygit:toggle()
rootiest.toggle_lazygit_term()
end,
desc = "LazyGit Terminal",
},
-- Icon Picker group
{
"<leader>I",
mode = "n",
lhs = "<leader>I",
group = "IconPicker",
icon = { icon = "󰥸", color = "orange" },
cond = function()
return icon_picker_loaded
end,
},
-- Pick Icon
{
"<Leader>Ii",
"<cmd>IconPickerNormal<cr>",
mode = "n",
lhs = "<leader>Ii",
rhs = "<cmd>IconPickerNormal<cr>",
desc = "Pick Icon",
group = "IconPicker",
cond = function()
return icon_picker_loaded
end,
},
-- Yank Icon
{
"<Leader>Iy",
"<cmd>IconPickerYank<cr>",
mode = "n",
lhs = "<leader>Iy",
rhs = "<cmd>IconPickerYank<cr>",
desc = "Yank Icon",
group = "IconPicker",
cond = function()
return icon_picker_loaded
end,
},
-- Insert Icon in insert mode
{
mode = "i",
"<C-i>",
"<cmd>IconPickerInsert<cr>",
lhs = "<C-i>",
rhs = "<cmd>IconPickerInsert<cr>",
desc = "Insert Icon",
group = "IconPicker",
cond = function()
return icon_picker_loaded
end,
},
{
"<leader>gS",
@@ -50,21 +74,35 @@ wk.add({
end,
desc = "LazyGit",
},
-- Gists group
{
"<leader>gn",
mode = "n",
lhs = "<leader>gn",
group = "Gists",
icon = { icon = "", color = "orange" },
cond = function()
return gist_loaded
end,
},
-- Create Gist
{
mode = { "n", "x" },
"<leader>gnc",
"<cmd>GistCreate<cr>",
lhs = "<leader>gnc",
rhs = "<cmd>GistCreate<cr>",
desc = "Create Gist",
cond = function()
return gist_loaded
end,
},
-- Find Gists
{
"<leader>gnf",
"<cmd>GistList<cr>",
mode = "n",
lhs = "<leader>gnf",
rhs = "<cmd>GistList<cr>",
desc = "Find Gists",
cond = function()
return gist_loaded
end,
},
{
"<leader>l",
@@ -85,29 +123,45 @@ wk.add({
group = "MiniMap",
icon = { icon = "", color = "yellow" },
},
-- Save selected code snapshot into clipboard
{
"<leader>cy",
"<cmd>CodeSnap<cr>",
mode = "x",
lhs = "<leader>cy",
rhs = "<cmd>CodeSnap<cr>",
desc = "Save selected code snapshot into clipboard",
cond = function()
return codesnap_loaded
end,
},
-- Save selected code snapshot in ~/Pictures
{
"<leader>cs",
"<cmd>CodeSnapSave<cr>",
mode = "x",
lhs = "<leader>cs",
rhs = "<cmd>CodeSnapSave<cr>",
desc = "Save selected code snapshot in ~/Pictures",
cond = function()
return codesnap_loaded
end,
},
-- Highlight and snapshot selected code into clipboard
{
"<leader>ch",
"<cmd>CodeSnapHighlight<cr>",
mode = "x",
lhs = "<leader>ch",
rhs = "<cmd>CodeSnapHighlight<cr>",
desc = "Highlight and snapshot selected code into clipboard",
cond = function()
return codesnap_loaded
end,
},
-- Save ASCII code snapshot into clipboard
{
"<leader>ci",
"<cmd>CodeSnapASCII<cr>",
mode = "x",
lhs = "<leader>ci",
rhs = "<cmd>CodeSnapASCII<cr>",
desc = "Save ASCII code snapshot into clipboard",
cond = function()
return codesnap_loaded
end,
},
{
"gx",
@@ -135,9 +189,7 @@ wk.add({
end,
desc = "KittyNavigateLeft",
cond = function() -- Using Kitty
local term = os.getenv("TERM") or ""
local kit = string.find(term, "kitty")
return kit ~= nil
return rootiest.using_kitty()
end,
},
{
@@ -147,9 +199,7 @@ wk.add({
end,
desc = "KittyNavigateDown",
cond = function() -- Using Kitty
local term = os.getenv("TERM") or ""
local kit = string.find(term, "kitty")
return kit ~= nil
return rootiest.using_kitty()
end,
},
{
@@ -159,9 +209,7 @@ wk.add({
end,
desc = "KittyNavigateUp",
cond = function() -- Using Kitty
local term = os.getenv("TERM") or ""
local kit = string.find(term, "kitty")
return kit ~= nil
return rootiest.using_kitty()
end,
},
{
@@ -171,15 +219,13 @@ wk.add({
end,
desc = "KittyNavigateRight",
cond = function() -- Using Kitty
local term = os.getenv("TERM") or ""
local kit = string.find(term, "kitty")
return kit ~= nil
return rootiest.using_kitty()
end,
},
{
"zk",
rhs = function()
require("precognition").toggle()
rootiest.toggle_precognition()
end,
desc = "Toggle Precognition",
},
@@ -213,14 +259,15 @@ wk.add({
},
{
"yo",
"<cmd>YankLine<cr>",
rhs = function()
rootiest.yank_line()
end,
desc = "Yank Line-text",
},
{ -- Toggle Hardmode with Hints
"<leader>h",
rhs = function()
vim.cmd("Hardtime toggle")
require("precognition").toggle()
rootiest.toggle_hardmode()
end,
desc = "Toggle Hardmode",
},
@@ -231,14 +278,55 @@ wk.add({
end,
desc = "Toggle ZenMode",
},
-- Substitute operator in normal mode
{
mode = "n",
lhs = "x",
rhs = function()
substitute.operator()
end,
desc = "Substitute operator",
cond = function()
return substitute_loaded
end,
},
-- Substitute line in normal mode
{
mode = "n",
lhs = "xx",
rhs = function()
substitute.line()
end,
desc = "Substitute line",
cond = function()
return substitute_loaded
end,
},
-- Substitute end of line in normal mode
{
mode = "n",
lhs = "X",
rhs = function()
substitute.eol()
end,
desc = "Substitute end of line",
cond = function()
return substitute_loaded
end,
},
-- Substitute visual selection in visual mode
{
mode = "x",
lhs = "x",
rhs = function()
substitute.visual()
end,
desc = "Substitute visual selection",
cond = function()
return substitute_loaded
end,
},
})
-- Substitute
-- Define substitue mappings
vim.keymap.set("n", "x", require("substitute").operator, { noremap = true })
vim.keymap.set("n", "xx", require("substitute").line, { noremap = true })
vim.keymap.set("n", "X", require("substitute").eol, { noremap = true })
vim.keymap.set("x", "x", require("substitute").visual, { noremap = true })
-- ---------------------------- Spell Correction -------------------------------
require("config.spellcheck")
-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.ui" }, -- UI Plugins
{ import = "plugins" }, -- General Plugins
},
defaults = { lazy = false, version = false },
+2 -23
View File
@@ -2,29 +2,8 @@
-- --------------------------------- OPTIONS -----------------------------------
-- -----------------------------------------------------------------------------
-- Set Default Leader Key
vim.g.mapleader = " "
-- Correct missing settings files
require("config.check-files")
-- Load Stored Leader Key
vim.g.mapleader = vim.fn.readfile(vim.fn.stdpath("config") .. "/.leader")[1]
-- Load the stored colorscheme
STORED_THEME = vim.fn.readfile(vim.fn.stdpath("config") .. "/.colorscheme")[1]
-- ----------------------------------- LSP --------------------------------------
-- We don't need perl
vim.g.loaded_perl_provider = 0
-- Prefer basedpyright
vim.g.lazyvim_python_lsp = "basedpyright"
-- ----------------------------------- FOLDS --------------------------------------
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.opt.foldlevelstart = 99 -- load buffers with folds open
-- ------------------------------- CLIENT APPS ---------------------------------
if vim.g.neovide then
-- ----------------------- Neovide -------------------------
require("config.neovide")
end
+230
View File
@@ -0,0 +1,230 @@
local M = {}
local precog_first_time = true
-- Define the config path and default values
local config_path = vim.fn.stdpath("config")
function M.set_defaults()
-- Set Default Leader Key
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
end
function M.eval_settings_files()
-- Function to ensure a file exists and write a default value if it doesn't
local function ensure_file_exists(file_path, default_value, setup_func)
if vim.fn.filereadable(file_path) ~= 1 then
if setup_func then
-- Call the setup function if provided
setup_func()
else
-- Write default value to file
vim.fn.writefile({ default_value }, file_path)
end
end
end
local defaults = {
[config_path .. "/.aitool"] = "codeium",
[config_path .. "/.useimage"] = "true",
[config_path .. "/.wakatime"] = "true",
[config_path .. "/.hardtime"] = "false",
[config_path .. "/.ignore-deps"] = "false",
[config_path .. "/.leader"] = vim.g.mapleader,
}
-- Function to handle special logic for the .colorscheme file
local function setup_colorscheme()
local color_file = config_path .. "/.colorscheme"
if M.kitty_theme then
vim.fn.writefile({ M.kitty_theme }, color_file)
else
vim.fn.writefile({ vim.g.colors_name }, color_file)
end
end
-- Ensure each file exists with the corresponding default value or special logic
for file_path, default_value in pairs(defaults) do
ensure_file_exists(file_path, default_value)
end
-- Ensure the .colorscheme file exists with special logic
ensure_file_exists(config_path .. "/.colorscheme", nil, setup_colorscheme)
end
function M.restore_colorscheme()
-- Restore colorscheme
vim.cmd.colorscheme(M.colortheme or "catppuccin-frappe" or "tokyonight")
end
function M.yank_line()
-- Yank line without leading/trailing whitespace
vim.api.nvim_feedkeys("_v$hy$", "n", true)
end
function M.using_kitty()
local term = os.getenv("TERM") or ""
local kit = string.find(term, "kitty")
return kit ~= nil
end
function M.toggle_precognition()
if precog_first_time then
require("precognition").toggle()
require("precognition").toggle() -- Call toggle twice
precog_first_time = false -- Update variable after the first call
else
require("precognition").toggle() -- Call toggle once
end
end
function M.toggle_hardmode()
require("hardtime").toggle()
M.toggle_precognition()
end
function M.toggle_lazygit_term()
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
lazygit:toggle()
end
-- Function to check if a given string matches the content of the .aitool file
function M.using_aitool(input)
local aitool_file = config_path .. "/.aitool"
-- Ensure the .aitool file exists
if vim.fn.filereadable(aitool_file) ~= 1 then
vim.fn.writefile({ "codeium" }, aitool_file)
end
-- Read the file and normalize its content
local content = vim.fn.readfile(aitool_file)[1] or ""
local normalized_content = content:lower():gsub("%s+", "")
-- Normalize the input and compare
local normalized_input = input:lower():gsub("%s+", "")
return normalized_input == normalized_content
end
function M.load_remote()
---@diagnostic disable-next-line: missing-parameter
require("remote-nvim").setup()
vim.cmd("RemoteStart")
end
function M.set_cursor_icons()
-- Define last cursor position icon
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_", { text = "" })
vim.fn.sign_define("smoothcursor_R", { text = "󰊄" })
end
function M.eval_dependencies()
-- Function to read the .ignore-deps file and return whether warnings should be suppressed
local function should_suppress_warnings()
local ignore_file = config_path .. "/.ignore-deps"
local file = io.open(ignore_file, "r")
if file then
local content = file:read("*a")
file:close()
content = content:lower():gsub("%s+", "") -- convert to lowercase and remove whitespace
local suppress_values = { ["true"] = true, ["1"] = true, ["yes"] = true }
return suppress_values[content] or false
end
return false
end
-- Function to check if an executable is installed and generate a warning if not
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
-- Check if warnings should be suppressed
if not should_suppress_warnings() then
-- List of executables to check
local executables =
{ "lazygit", "gh", "rg", "fzf", "fd", "git", "luarocks" }
-- Check each executable
for _, executable in ipairs(executables) do
check_executable(executable)
end
end
end
function M.eval_neovide()
if vim.g.neovide then
require("config.neovide")
end
end
-- -------------------------------- Commands -----------------------------------
function M.define_commands()
-- Make :Q close all of the buffers
vim.api.nvim_create_user_command("Q", function()
vim.cmd.qall()
end, { force = true, desc = "Close all buffers" })
-- Yank line without leading/trailing whitespace
vim.api.nvim_create_user_command("YankLine", function()
M.yank_line()
end, { force = true, desc = "Yank line without leading whitespace" })
-- Restore Colorscheme
-- Define the RestoreColorscheme command
vim.api.nvim_create_user_command(
"RestoreColorscheme", -- Command name
function() -- Callback function
M.restore_colorscheme()
end,
{ desc = "Restore colorscheme" }
)
-- Load/start Remote
vim.api.nvim_create_user_command("LoadRemote", function()
M.load_remote()
end, { force = true, desc = "Load/start Remote" })
end
-- ------------------------------- Variables -----------------------------------
-- Load the kitty theme
M.kitty_theme = os.getenv("KITTY_THEME")
-- Load the stored colorscheme
M.colortheme = vim.fn.readfile(config_path .. "/.colorscheme")[1]
-- Load Stored Leader Key
M.leader = vim.fn.readfile(config_path .. "/.leader")[1]
-- --------------------------------- Setup -------------------------------------
function M.setup()
-- Set Defaults
M.set_defaults()
-- Define Commands
M.define_commands()
-- Evaluate settings files
M.eval_settings_files()
-- Evaluate dependencies
M.eval_dependencies()
-- Evaluate neovide settings
M.eval_neovide()
-- Restore colorscheme
M.restore_colorscheme()
-- Set cursor icons
M.set_cursor_icons()
-- Load Stored Leader Key
vim.g.mapleader = M.leader
end
return M
-120
View File
@@ -1,120 +0,0 @@
-- -----------------------------------------------------------------------------
-- ----------------------------------- UI --------------------------------------
-- -----------------------------------------------------------------------------
return {
{ -- Edgy
import = "lazyvim.plugins.extras.ui.edgy",
},
{ -- Mini-animate
import = "lazyvim.plugins.extras.ui.mini-animate",
},
{ -- Transparent
"xiyaowong/transparent.nvim",
lazy = true,
config = true,
},
{ -- Auto Dark Mode
"f-person/auto-dark-mode.nvim",
lazy = true,
opts = {
update_interval = 2000,
set_dark_mode = function()
vim.o.background = "dark"
vim.cmd.colorscheme(
STORED_THEME or KITTY_THEME or "catppuccin-frappe" or "tokyonight"
)
end,
set_light_mode = function()
vim.o.background = "light"
vim.cmd.colorscheme(
STORED_THEME or KITTY_THEME or "catppuccin-frappe" or "tokyonight"
)
end,
},
cond = function() -- Not Using SSH
local ssh = os.getenv("SSH_TTY") or false
return not ssh
end,
},
{ -- Hlchunk
"shellRaining/hlchunk.nvim",
event = "BufEnter",
config = function()
local cb = function()
if vim.g.colors_name == "tokyonight" then
return "#806d9c"
elseif vim.g.colors_name:find("catppuccin") then
local catpalette = require("catppuccin.palettes").get_palette()
return catpalette.teal
elseif vim.g.colors_name == "monochrome" or "github_dark" then
return "#CCCCCC"
elseif vim.g.colors_name == "gruvbox" then
return "#a9b665"
elseif vim.g.colors_name == "dracula" or "eldritch" then
return "#50fa7b"
elseif vim.g.colors_name == "onedark" or "nightfox" then
return "#98C379"
elseif vim.g.colors_name == "nord" then
return "#81A1C1"
elseif vim.g.colors_name == "kanagawa" then
return "#73C8AD"
elseif vim.g.colors_name == "everforest" then
return "#8FBCBB"
elseif vim.g.colors_name == "github_light" or "paper" then
return "#3f3f5a"
elseif vim.g.colors_name == "neofusion" then
return "#420ADD"
else
return "#7581FF"
end
end
local common_config = {
chunk = {
style = {
{ fg = cb },
},
enable = true,
},
indent = {
enable = true,
use_treesitter = true,
chars = {
"․․",
"⁚⁚",
"⁖⁖",
"⁘⁘",
"⁙⁙",
"󱗿󱗿",
"󱗽󱗽",
"󱗼󱗼",
},
},
}
if vim.o.background == "dark" then
common_config.indent.style = {
{ fg = "#434437" },
{ fg = "#2f4440" },
{ fg = "#433054" },
{ fg = "#284251" },
{ fg = "#3e4451" },
{ fg = "#565c64" },
{ fg = "#6b737f" },
{ fg = "#848a91" },
}
else
common_config.indent.style = {
{ fg = "#d0b0b0" },
{ fg = "#b0b0d0" },
{ fg = "#b0d0b0" },
{ fg = "#a0a0a0" },
{ fg = "#c0c0c0" },
{ fg = "#e0e0e0" },
{ fg = "#f0f0f0" },
{ fg = "#ffffff" },
}
end
require("hlchunk").setup(common_config)
end,
},
}
-17
View File
@@ -1,17 +0,0 @@
-- -----------------------------------------------------------------------------
-- ---------------------------------- USER -------------------------------------
-- -----------------------------------------------------------------------------
--
-- ---------------------------------- STYLE ------------------------------------
----------------------------- Apply the colorscheme ----------------------------
-------- 1. Restore last colorscheme if it exists --------
-------- 2. Use kitty theme if it exists --------
-------- 3. Fallback to Catppuccin Frappe --------
-------- 4. Fallback to Tokyonight --------
--------------------------------------------------------------------------------
vim.cmd.colorscheme(
STORED_THEME or KITTY_THEME or "catppuccin-frappe" or "tokyonight"
)
-- ---------------------------------- CUSTOM ------------------------------------
-- Add any custom configuration below
+5 -24
View File
@@ -1,39 +1,25 @@
-- -----------------------------------------------------------------------------
-- --------------------------------- CODING ------------------------------------
-- -----------------------------------------------------------------------------
local rootiest = require("config.rootiest")
return {
{ -- Codeium
import = "lazyvim.plugins.extras.coding.codeium",
cond = function()
if
vim.fn.readfile(vim.fn.stdpath("config") .. "/.aitool")[1]
== "codeium"
then
return true
end
return rootiest.using_aitool("codeium")
end,
},
{ -- Copilot
import = "lazyvim.plugins.extras.coding.copilot",
cond = function()
if
vim.fn.readfile(vim.fn.stdpath("config") .. "/.aitool")[1]
== "copilot"
then
return true
end
return rootiest.using_aitool("copilot")
end,
},
{ -- Tabnine
import = "lazyvim.plugins.extras.coding.tabnine",
cond = function()
if
vim.fn.readfile(vim.fn.stdpath("config") .. "/.aitool")[1]
== "tabnine"
then
return true
end
return rootiest.using_aitool("tabnine")
end,
},
{ -- Minuet-AI
@@ -43,12 +29,7 @@ return {
require("minuet").setup({ provider = "openai" })
end,
cond = function()
if
vim.fn.readfile(vim.fn.stdpath("config") .. "/.aitool")[1]
== "minuet"
then
return true
end
return rootiest.using_aitool("minuet")
end,
},
{ -- Yanky
+90 -42
View File
@@ -1,8 +1,16 @@
-- -----------------------------------------------------------------------------
-- --------------------------------- EDITOR ------------------------------------
-- -----------------------------------------------------------------------------
local rootiest = require("config.rootiest")
return {
{ -- Edgy
import = "lazyvim.plugins.extras.ui.edgy",
},
{ -- Mini-animate
import = "lazyvim.plugins.extras.ui.mini-animate",
},
{ -- Aerial
import = "lazyvim.plugins.extras.editor.aerial",
},
@@ -159,48 +167,8 @@ return {
event = "InsertEnter",
lazy = true,
config = function()
require("smoothcursor").setup({
type = "default",
cursor = "",
texthl = "SmoothCursor",
fancy = {
enable = true, -- enable fancy mode
head = { cursor = "" },
body = {},
tail = { false }, -- false to disable fancy tail
},
matrix = { -- Loaded when 'type' is set to "matrix"
head = {
cursor = require("smoothcursor.matrix_chars"),
texthl = {
"SmoothCursor",
},
},
body = {
length = 6, -- Specifies the length of the cursor body
cursor = require("smoothcursor.matrix_chars"),
texthl = {
"SmoothCursorGreen",
},
},
tail = {
texthl = {
"SmoothCursor",
},
},
unstop = false,
},
autostart = true, -- Automatically start SmoothCursor
always_redraw = true, -- Redraw the screen on each update
flyin_effect = "bottom", -- Choose "bottom" or "top" for flying effect
speed = 25, -- Max speed is 100 to stick with your current position
intervals = 35, -- Update intervals in milliseconds
priority = 10, -- Set marker priority
timeout = 3000, -- Timeout for animations in milliseconds
threshold = 3, -- Animate only if cursor moves more than this many lines
max_threshold = 2000, -- If you move more than this many lines, don't animate (if `nil`, deactivate check)
disable_float_win = false, -- Disable in floating windows
})
---@diagnostic disable-next-line: missing-parameter
require("smoothcursor").setup()
-- Define last cursor position icon
vim.fn.sign_define("smoothcursor_n", { text = "" })
vim.fn.sign_define("smoothcursor_v", { text = "" })
@@ -210,4 +178,84 @@ return {
vim.fn.sign_define("smoothcursor_R", { text = "󰊄" })
end,
},
{ -- Hlchunk
"shellRaining/hlchunk.nvim",
event = "BufEnter",
config = function()
local cb = function()
if vim.g.colors_name == "tokyonight" then
return "#806d9c"
elseif vim.g.colors_name:find("catppuccin") then
local catpalette = require("catppuccin.palettes").get_palette()
return catpalette.teal
elseif vim.g.colors_name == "monochrome" or "github_dark" then
return "#CCCCCC"
elseif vim.g.colors_name == "gruvbox" then
return "#a9b665"
elseif vim.g.colors_name == "dracula" or "eldritch" then
return "#50fa7b"
elseif vim.g.colors_name == "onedark" or "nightfox" then
return "#98C379"
elseif vim.g.colors_name == "nord" then
return "#81A1C1"
elseif vim.g.colors_name == "kanagawa" then
return "#73C8AD"
elseif vim.g.colors_name == "everforest" then
return "#8FBCBB"
elseif vim.g.colors_name == "github_light" or "paper" then
return "#3f3f5a"
elseif vim.g.colors_name == "neofusion" then
return "#420ADD"
else
return "#7581FF"
end
end
local common_config = {
chunk = {
style = {
{ fg = cb },
},
enable = true,
},
indent = {
enable = true,
use_treesitter = true,
chars = {
"․․",
"⁚⁚",
"⁖⁖",
"⁘⁘",
"⁙⁙",
"󱗿󱗿",
"󱗽󱗽",
"󱗼󱗼",
},
},
}
if vim.o.background == "dark" then
common_config.indent.style = {
{ fg = "#434437" },
{ fg = "#2f4440" },
{ fg = "#433054" },
{ fg = "#284251" },
{ fg = "#3e4451" },
{ fg = "#565c64" },
{ fg = "#6b737f" },
{ fg = "#848a91" },
}
else
common_config.indent.style = {
{ fg = "#d0b0b0" },
{ fg = "#b0b0d0" },
{ fg = "#b0d0b0" },
{ fg = "#a0a0a0" },
{ fg = "#c0c0c0" },
{ fg = "#e0e0e0" },
{ fg = "#f0f0f0" },
{ fg = "#ffffff" },
}
end
require("hlchunk").setup(common_config)
end,
},
}
+11 -8
View File
@@ -91,20 +91,23 @@ return {
require("image").setup()
end,
cond = function()
if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.useimage") == 1 then
if
vim.fn.readfile(vim.fn.stdpath("config") .. "/.useimage")[1]
== "true"
then
local function is_useimage_enabled()
local useimage_file = vim.fn.stdpath("config") .. "/.useimage"
local content = vim.fn.readfile(useimage_file)[1] or ""
content = content:lower():gsub("%s+", "") -- convert to lowercase and remove whitespace
local enable_values = { ["true"] = true, ["1"] = true, ["yes"] = true }
if enable_values[content] then
local wterm = os.getenv("TERM_PROGRAM")
local kterm = os.getenv("TERM") or ""
local kit = string.find(kterm, "kitty")
if wterm and string.find(wterm, "WezTerm") then
if wterm and wterm:find("WezTerm") then
return true -- Using WezTerm
else
return kit ~= nil -- Using Kitty
return kterm:find("kitty") ~= nil -- Using Kitty
end
end
return false
end
end,
},
+31 -1
View File
@@ -1,8 +1,10 @@
-- -----------------------------------------------------------------------------
-- --------------------------------- THEMES ------------------------------------
-- -----------------------------------------------------------------------------
local rootiest = require("config.rootiest")
return {
-- ----------------------- Themes --------------------------
{ -- Tokyonight
"folke/tokyonight.nvim",
lazy = false, -- Override
@@ -10,7 +12,6 @@ return {
{ -- Catppuccin
"catppuccin/nvim",
lazy = false, -- Override
opts = { integrations = { grug_far = true } },
},
{ -- Ayu
"Shatur/neovim-ayu",
@@ -59,4 +60,33 @@ return {
"zenbones-theme/zenbones.nvim",
dependencies = { "rktjmp/lush.nvim" },
},
-- ---------------------- Utilities ------------------------
{ -- Transparent
"xiyaowong/transparent.nvim",
lazy = true,
config = true,
},
{ -- Auto Dark Mode
"f-person/auto-dark-mode.nvim",
lazy = true,
opts = {
update_interval = 2000,
set_dark_mode = function()
vim.o.background = "dark"
vim.cmd.colorscheme(
rootiest.colortheme or "catppuccin-frappe" or "tokyonight"
)
end,
set_light_mode = function()
vim.o.background = "light"
vim.cmd.colorscheme(
rootiest.colortheme or "catppuccin-latte" or "tokyonight-day"
)
end,
},
cond = function() -- Not Using SSH
local ssh = os.getenv("SSH_TTY") or false
return not ssh
end,
},
}
+22 -15
View File
@@ -22,12 +22,18 @@ return {
{ -- Wakatime
"wakatime/vim-wakatime",
cond = function()
if
vim.fn.readfile(vim.fn.stdpath("config") .. "/.wakatime")[1]
== "true"
then
return true
local function is_wakatime_enabled()
local wakatime_file = vim.fn.stdpath("config") .. "/.wakatime"
local content = vim.fn.readfile(wakatime_file)[1] or ""
content = content:lower():gsub("%s+", "") -- convert to lowercase and remove whitespace
local enable_values = { ["true"] = true, ["1"] = true, ["yes"] = true }
if enable_values[content] then
return { enabled = true }
else
return { enabled = false }
end
end
return is_wakatime_enabled()
end,
},
{ -- Link following
@@ -43,9 +49,6 @@ return {
{ -- Auto-save
"Pocco81/auto-save.nvim",
event = "InsertEnter",
config = function()
require("auto-save").setup({})
end,
},
{ -- User is bored
"mikesmithgh/ugbi",
@@ -126,14 +129,18 @@ return {
"m4xshen/hardtime.nvim",
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
opts = function()
if
vim.fn.readfile(vim.fn.stdpath("config") .. "/.hardtime")[1]
== "true"
then
return { enabled = true }
else
return { enabled = false }
local function is_hardtime_enabled()
local hardtime_file = vim.fn.stdpath("config") .. "/.hardtime"
local content = vim.fn.readfile(hardtime_file)[1] or ""
content = content:lower():gsub("%s+", "") -- convert to lowercase and remove whitespace
local enable_values = { ["true"] = true, ["1"] = true, ["yes"] = true }
if enable_values[content] then
return { enabled = true }
else
return { enabled = false }
end
end
return is_hardtime_enabled()
end,
},
{ -- GitLinker