added nvim

This commit is contained in:
Daniel Fichtinger 2024-11-03 15:03:42 -05:00
parent 02fe17d9a1
commit 975099489a
34 changed files with 1523 additions and 0 deletions

View file

@ -0,0 +1,8 @@
-- TODO: turn this into a plugin? lol
local M = {}
function M.command(command_name)
vim.cmd('call feedkeys(":' .. command_name .. ' ", "n")')
end
return M

View file

@ -0,0 +1,74 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here
vim.cmd("let &t_ut=''")
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "markdown" },
callback = function()
vim.opt_local.breakindent = true
vim.opt_local.wrap = true
vim.opt_local.spell = true
vim.api.nvim_buf_set_keymap(
0,
"i",
"<M-i>",
"__<Left>",
{ desc = "Markdown: Italics", noremap = true, silent = true }
)
vim.api.nvim_buf_set_keymap(0, "i", "<M-d>", "- [ ] ", { desc = "Markdown: Task", noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(
0,
"i",
"<M-a>",
"<Esc>I# ",
{ desc = "Markdown: Heading", noremap = true, silent = true }
)
vim.api.nvim_buf_set_keymap(
0,
"i",
"<M-r>",
"<Esc>I## ",
{ desc = "Markdown: Heading", noremap = true, silent = true }
)
vim.api.nvim_buf_set_keymap(
0,
"i",
"<M-s>",
"<Esc>I### ",
{ desc = "Markdown: Heading", noremap = true, silent = true }
)
vim.api.nvim_buf_set_keymap(
0,
"i",
"<M-t>",
"<Esc>I#### ",
{ desc = "Markdown: Heading", noremap = true, silent = true }
)
vim.api.nvim_buf_set_keymap(
0,
"i",
"<M-g>",
"<Esc>I##### ",
{ desc = "Markdown: Heading", noremap = true, silent = true }
)
vim.api.nvim_buf_set_keymap(
0,
"i",
"<M-b>",
"****<Left><Left>",
{ desc = "Markdown: Bold", noremap = true, silent = true }
)
vim.api.nvim_buf_set_keymap(
0,
"i",
"<M-e>",
"<Esc>I- ",
{ desc = "Markdown: Bullet Point", noremap = true, silent = true }
)
local wk = require("which-key")
wk.add({
{ "<M-i>", mode = "i", desc = "Markdown Italics" },
{ "<M-b>", mode = "i", desc = "Markdown Bold" },
})
end,
})

View file

@ -0,0 +1,120 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
local map = vim.keymap.set
local wk = require("which-key")
-- unbind ctrl S since it's tmux prefix
-- vim.keymap.del({ "i", "n" }, "<C-t>")
vim.keymap.set({ "i", "n" }, "<C-t>", "<Nop>")
local dirmap = {
up = "w0",
down = "w$",
}
local function move_cursor_to(direction) end
-- TODO: finish this
-- local function scroll(direction)
-- -- current window for now; could extend later
-- local win_id = 0
-- -- in form {line, column}
-- local current_cursor = vim.api.nvim_win_get_cursor(win_id)
--
-- -- this is the height of the window in lines
-- local win_height = vim.api.nvim_win_get_height(win_id)
--
-- local new_top = vim.fn.line(dirmap[direction])
--
-- end
-- Bind arrows to hjkl to my colemak-dh motions work as expected
map({ "n", "x" }, "<Up>", "k", { desc = "Up", remap = true })
map({ "n", "x" }, "<Down>", "j", { desc = "Down", remap = true })
map({ "n", "x" }, "<Left>", "h", { desc = "Left", remap = true })
map({ "n", "x" }, "<Right>", "l", { desc = "Right", remap = true })
-- map({ "n", "x" }, "<PageDown>", function()
-- move_cursor_to("down")
-- end, { desc = "Move cursor to bottom", remap = true })
-- map({ "n", "x" }, "<PageUp>", function()
-- move_cursor_to("up")
-- end, { desc = "Move cursor to top", remap = true })
-- map({ "n", "t" }, "<C-Left>", "<C-H>", { desc = "Switch Window Left", remap = true })
-- map({ "n", "t" }, "<C-Right>", "<C-L>", { desc = "Switch Window Right", remap = true })
-- map({ "n", "t" }, "<C-Up>", "<C-K>", { remap = true })
-- map({ "n", "t" }, "<C-Down>", "<C-J>", { desc = "Switch Window Down", remap = true })
map({ "n", "t", "i" }, "<C-Left>", "<cmd> TmuxNavigateLeft<CR>", { desc = "Switch Window Left", remap = true })
map({ "n", "t", "i" }, "<C-Right>", "<cmd> TmuxNavigateRight<CR>", { desc = "Switch Window Right", remap = true })
map({ "n", "t", "i" }, "<C-Up>", "<cmd> TmuxNavigateUp<CR>", { remap = true })
map({ "n", "t", "i" }, "<C-Down>", "<cmd> TmuxNavigateDown<CR>", { desc = "Switch Window Down", remap = true })
map({ "x" }, "<M-Left>", "<M-h>", { remap = true })
map({ "x" }, "<M-Right>", "<M-l>", { remap = true })
map({ "n", "x", "v" }, "<M-Up>", "<M-k>", { remap = true })
map({ "n", "x", "v" }, "<M-Down>", "<M-j>", { remap = true })
map({ "n" }, "<S-Left>", "H", { desc = "Left Buffer", remap = true })
map({ "n" }, "<S-Right>", "L", { desc = "Right Buffer", remap = true })
map({ "n" }, "<S-Down>", "5j", { remap = true })
map({ "n" }, "<S-Up>", "5k", { remap = true })
map({ "i" }, "<M-e>", "<Esc>", { desc = "Escape insert mode", remap = true })
-- <PageDown><PageUp>
-- Remap spelling suggestions
-- map({ "n" }, "z-", "z=", { desc = "Spelling Suggestions", remap = true })
-- Oil.nvim open parent directory
map("n", "-", "<CMD>Oil<CR>", { desc = "Open Oil" })
-- TODO: add leader + y for save current buf, leader + Y to write all
map({ "n", "x" }, "<leader>y", "<CMD>w<CR>", { desc = "Save" })
map({ "n", "x" }, "<leader>Y", "<CMD>wa<CR>", { desc = "Save All" })
-- Zen Mode
map("n", "<leader>uz", "<CMD>ZenMode<CR>", { desc = "Toggle Zen Mode" })
-- Source Current File
map("n", "<leader><leader>x", "<CMD>source %<CR>", { desc = "Source current file" })
-- Obsidian
-- <leader>o is the prefix for all Obsidian bindings
wk.add({
{ "<leader>o", group = "Obsidian" },
{ "<leader>od", group = "Daily Note" },
{ "<leader>ol", group = "Follow Link" },
})
map("n", "<leader>oo", "<CMD>ObsidianQuickSwitch<CR>", { desc = "Obsidian Quick Switch" })
map("n", "<leader>o/", "<CMD>ObsidianSearch<CR>", { desc = "Obsidian Grep" })
-- This one will open the command line and let the user type the arg
map("n", "<leader>on", function()
require("command-key").command("ObsidianNew")
end, { desc = "Obsidian New Note" })
map("n", "<leader>ob", "<CMD>ObsidianBacklinks<CR>", { desc = "Obsidian Backlinks" })
-- map("n", "<leader>ot", function()
-- require("command-key").command("ObsidianTags")
-- end, { desc = "Obsidian Tags" })
map("n", "<leader>ot", "<CMD>ObsidianTags<CR>", { desc = "Obsidian Tags" })
map("n", "<leader>olv", "<CMD>ObsidianFollowLink vsplit<CR>", { desc = "Obsidian Follow Link Vsplit" })
map("n", "<leader>olh", "<CMD>ObsidianFollowLink hsplit<CR>", { desc = "Obsidian Follow Link Hsplit" })
map("n", "<leader>odt", "<CMD>ObsidianToday<CR>", { desc = "Obsidian Open Today's Daily" })
map("n", "<leader>ods", "<CMD>ObsidianDailies<CR>", { desc = "Obsidian Search Dailies" })
map("n", "<leader>ols", "<CMD>ObsidianLinks<CR>", { desc = "Obsidian Search Links" })
map("x", "<leader>oll", function()
require("command-key").command("ObsidianLink")
end, { desc = "Obsidian Link Visual To Existing Note" })
map("x", "<leader>oln", function()
require("command-key").command("ObsidianLinkNew")
end, { desc = "Obsidian Link Visual To New Note" })
map("x", "<leader>ole", function()
require("command-key").command("ObsidianExtractNote")
end, { desc = "Obsidian Copy Selection To New Note & Link" })
map("n", "<leader>or", function()
require("command-key").command("ObsidianRename")
end, { desc = "Obsidian Rename" })
map("n", "<leader>oc", "<CMD>ObsidianTOC<CR>", { desc = "Obsidian Table Of Contents" })
-- TODO: Add binds for templates

View file

@ -0,0 +1,53 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = {
enabled = true, -- check for plugin updates periodically
notify = false, -- notify on update
}, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

View file

@ -0,0 +1,4 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
vim.o.scrolloff = 2

View file

@ -0,0 +1,103 @@
local dev = false
-- local theme = "darkvoid"
local theme = "kanagawa-dragon"
-- #0f0f0f
-- #933737
-- #A23D3D
-- #994848
-- #7B7F80
-- #7C8080
-- #8D8D8D
-- #d4d4d4
-- #949494
-- #933737
-- #A23D3D
-- #994848
-- #7B7F80
-- #7C8080
-- #8D8D8D
-- #d4d4d4
return {
-- { "rebelot/kanagawa.nvim" },
{
"aliqyan-21/darkvoid.nvim",
-- dir = dev and "~/dev/darkvoid.nvim" or false,
opts = {
glow = false,
-- colors = {
-- fg = "#c0c0c0",
-- bg = "#1c1c1c",
-- -- bg = "#000000",
-- cursor = "#bdfe58",
-- line_nr = "#404040",
-- visual = "#303030",
-- comment = "#585858",
-- string = "#d1d1d1",
-- func = "#e1e1e1",
-- kw = "#f1f1f1",
-- identifier = "#b1b1b1",
-- type = "#a1a1a1",
-- type_builtin = "#c5c5c5", -- current
-- -- type_builtin = "#8cf8f7", -- glowy blue old (was present by default before type_builtin was introduced added here for people who may like it)
-- search_highlight = "#1bfd9c",
-- operator = "#1bfd9c",
-- bracket = "#e6e6e6",
-- preprocessor = "#4b8902",
-- bool = "#66b2b2",
-- constant = "#b2d8d8",
-- -- special = "#8cf8f7",
--
-- -- enable or disable specific plugin highlights
-- plugins = {
-- gitsigns = true,
-- nvim_cmp = true,
-- treesitter = true,
-- nvimtree = true,
-- telescope = true,
-- lualine = true,
-- bufferline = true,
-- oil = true,
-- whichkey = true,
-- nvim_notify = true,
-- -- leap = true,
-- },
--
-- -- gitsigns colors
-- added = "#baffc9",
-- changed = "#ffffba",
-- removed = "#ffb3ba",
--
-- -- Pmenu colors
-- pmenu_bg = "#1c1c1c",
-- pmenu_sel_bg = "#1bfd9c",
-- pmenu_fg = "#c0c0c0",
--
-- -- EndOfBuffer color
-- eob = "#3c3c3c",
--
-- -- Telescope specific colors
-- border = "#585858",
-- title = "#bdfe58",
--
-- -- bufferline specific colors
-- bufferline_selection = "#1bfd9c",
--
-- -- LSP diagnostics colors
-- error = "#dea6a0",
-- warning = "#d6efd8",
-- hint = "#bedc74",
-- info = "#7fa1c3",
-- },
},
},
{
"LazyVim/LazyVim",
opts = {
-- colorscheme = theme,
colorscheme = function()
return { require("darkvoid").load() }
end,
},
},
}

View file

@ -0,0 +1,28 @@
return {
{
"zbirenbaum/copilot-cmp",
opts = function()
local copilot_toggle = require("lazyvim.util.toggle").wrap({
name = "Copilot Completion",
get = function()
return not require("copilot.client").is_disabled()
end,
set = function(state)
if state then
require("copilot.command").enable()
else
require("copilot.command").disable()
end
end,
})
-- disable by default
require("copilot.command").disable()
LazyVim.toggle.map("<leader>at", copilot_toggle)
end,
},
{ "CopilotC-Nvim/CopilotChat.nvim", opts = {
auto_insert_mode = false,
} },
}

View file

@ -0,0 +1,112 @@
-- return {
-- {
-- "zbirenbaum/copilot.lua",
-- cmd = "Copilot",
-- build = ":Copilot auth",
-- opts = {
-- suggestion = { enabled = false },
-- panel = { enabled = false },
-- filetypes = {
-- markdown = true,
-- help = true,
-- },
-- },
-- keys = {
-- {
-- "<leader>at",
-- function()
-- if require("copilot.client").is_disabled() then
-- require("copilot.command").enable()
-- else
-- require("copilot.command").disable()
-- end
-- end,
-- desc = "Toggle (Copilot)",
-- },
-- },
-- },
-- {
-- "folke/which-key.nvim",
-- opts = {
-- icons = {
-- rules = {
-- { plugin = "copilot.lua", icon = " ", color = "orange" }
-- }
-- }
-- }
-- },
-- {
-- "nvim-cmp",
-- dependencies = {
-- {
-- "zbirenbaum/copilot-cmp",
-- dependencies = "copilot.lua",
-- opts = {},
-- config = function(_, opts)
-- local copilot_cmp = require("copilot_cmp")
-- copilot_cmp.setup(opts)
-- -- attach cmp source whenever copilot attaches
-- -- fixes lazy-loading issues with the copilot cmp source
-- LazyVim.lsp.on_attach(function(client)
-- copilot_cmp._on_insert_enter({})
-- end, "copilot")
-- end,
-- },
-- },
-- ---@param opts cmp.ConfigSchema
-- opts = function(_, opts)
-- table.insert(opts.sources, 1, {
-- name = "copilot",
-- group_index = 1,
-- priority = 100,
-- })
-- end,
-- },
-- {
-- "zbirenbaum/copilot-cmp",
-- -- enabled = false,
-- dependencies = "copilot.lua",
-- opts = {},
-- config = function(_, opts)
-- local copilot_cmp = require("copilot_cmp")
-- copilot_cmp.setup(opts)
-- -- attach cmp source whenever copilot attaches
-- -- fixes lazy-loading issues with the copilot cmp source
-- LazyVim.lsp.on_attach(function(client)
-- copilot_cmp._on_insert_enter({})
-- end, "copilot")
-- end,
-- },
-- {
-- "CopilotC-Nvim/CopilotChat.nvim",
-- opts = function()
-- local user = vim.env.USER or "User"
-- user = user:sub(1, 1):upper() .. user:sub(2)
-- return {
-- auto_insert_mode = false,
-- show_help = true,
-- question_header = " " .. user .. " ",
-- answer_header = " Copilot ",
-- window = {
-- width = 0.4,
-- },
-- selection = function(source)
-- local select = require("CopilotChat.select")
-- return select.visual(source) or select.buffer(source)
-- end,
-- }
-- end,
-- },
-- {
-- "folke/edgy.nvim",
-- optional = true,
-- opts = function(_, opts)
-- opts.right = opts.right or {}
-- table.insert(opts.right, {
-- ft = "copilot-chat",
-- title = "Copilot Chat",
-- size = { width = 100 },
-- })
-- end,
-- },
-- }

View file

@ -0,0 +1,102 @@
return {
"nvimdev/dashboard-nvim",
lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.
opts = function()
-- local logo = [[
-- ██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
-- ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
-- ██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
-- ██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
-- ███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
-- ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
-- ]]
local saturn = [[
_.oo.
_.u[[/;:,. .odMMMMMM'
.o888UU[[[/;:-. .o@P^ MMM^
oN88888UU[[[/;::-. dP^
dNMMNN888UU[[[/;:--. .o@P^
,MMMMMMN888UU[[/;::-. o@^
NNMMMNN888UU[[[/~.o@P^
888888888UU[[[/o@^-..
oI8888UU[[[/o@P^:--..
.@^ YUU[[[/o@^;::---..
oMP ^/o@P^;:::---..
.dMMM .o@^ ^;::---...
dMMMMMMM@^` `^^^^
YMMMUP^
^^
]]
-- logo = string.rep("\n", 8) .. logo .. "\n\n"
saturn = string.rep("\n", 8) .. saturn .. "\n\n"
local function loadObsidian()
-- require("lazy").setup(require("plugins.obsidian"))
require("obsidian")
-- vim.api.nvim_input("<cmd>ObsidianWorkspace<cr>")
vim.api.nvim_input("<cmd>ObsidianTags<cr>")
end
local function openConfig()
local dir = "~/.config/nvim/"
vim.api.nvim_set_current_dir(dir)
vim.cmd("edit" .. dir)
end
local opts = {
theme = "doom",
hide = {
-- this is taken care of by lualine
-- enabling this messes up the actual laststatus setting after loading a file
statusline = false,
},
config = {
-- header = vim.split(logo, "\n"),
header = vim.split(saturn, "\n"),
-- stylua: ignore
center = {
-- { action = function() vim.cmd("edit " .. "~/second-brain/00-index/00-index.md") end, desc = " Open Obsidian Vault", icon = " ", key = "o" },
-- { action = 'lua LazyVim.pick()()', desc = " Find File", icon = " ", key = "f" },
-- { action = loadObsidian, desc = " Obsidian Tags", icon = "󱤇 ", key = "o" },
{ action = "ene | startinsert", desc = " New File", icon = "", key = "n" },
{ action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = "", key = "r" },
-- { action = 'lua LazyVim.pick("live_grep")()', desc = " Grep", icon = " ", key = "/" },
-- { action = function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, desc = " Git", icon = " ", key = "g" },
{ action = 'lua LazyVim.pick.config_files()()', desc = " Search Config", icon = "", key = "c" },
-- { action = openConfig, desc = " Open Config", icon = " ", key = "c" },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = "", key = "s" },
-- { action = 'lua require("persistence").select()', desc = " Select Session", icon = "󱦞 ", key = "S" },
{ action = "LazyExtras", desc = " Lazy Extras", icon = "", key = "x" },
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
{ action = function() vim.api.nvim_input("<cmd>qa<cr>") end, desc = " Quit", icon = "", key = "q" },
},
footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
end,
},
}
for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
button.key_format = " %s"
end
-- open dashboard after closing lazy
if vim.o.filetype == "lazy" then
vim.api.nvim_create_autocmd("WinClosed", {
pattern = tostring(vim.api.nvim_get_current_win()),
once = true,
callback = function()
vim.schedule(function()
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
end)
end,
})
end
return opts
end,
}

View file

@ -0,0 +1,8 @@
return {
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
{ "folke/tokyonight.nvim", enabled = false },
}
-- TODO:
-- figure out how to make markdown extra work together with Obsidian, disable it for now
-- either I can use the extra in markdown files but disable it and use obsidian in vault md files
-- OR find some way for them to coexist?

View file

@ -0,0 +1,193 @@
-- since this is just an example spec, don't actually load anything here and return an empty spec
-- stylua: ignore
if true then return {} end
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
--
-- In your plugin files, you can:
-- * add extra plugins
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
},
-- change trouble config
{
"folke/trouble.nvim",
-- opts will be merged with the parent spec
opts = { use_diagnostic_signs = true },
},
-- disable trouble
{ "folke/trouble.nvim", enabled = false },
-- override nvim-cmp and add cmp-emoji
{
"hrsh7th/nvim-cmp",
dependencies = { "hrsh7th/cmp-emoji" },
---@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, { name = "emoji" })
end,
},
-- change some telescope options and a keymap to browse plugin files
{
"nvim-telescope/telescope.nvim",
keys = {
-- add a keymap to browse plugin files
-- stylua: ignore
{
"<leader>fp",
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
desc = "Find Plugin File",
},
},
-- change some options
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
-- add pyright to lspconfig
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- pyright will be automatically installed with mason and loaded with lspconfig
pyright = {},
},
},
},
-- add tsserver and setup with typescript.nvim instead of lspconfig
{
"neovim/nvim-lspconfig",
dependencies = {
"jose-elias-alvarez/typescript.nvim",
init = function()
require("lazyvim.util").lsp.on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
end)
end,
},
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- tsserver will be automatically installed with mason and loaded with lspconfig
tsserver = {},
},
-- you can do any additional lsp server setup here
-- return true if you don't want this server to be setup with lspconfig
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
setup = {
-- example to setup with typescript.nvim
tsserver = function(_, opts)
require("typescript").setup({ server = opts })
return true
end,
-- Specify * to use this function as a fallback for any server
-- ["*"] = function(server, opts) end,
},
},
},
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
{ import = "lazyvim.plugins.extras.lang.typescript" },
-- add more treesitter parsers
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
},
},
},
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
-- would overwrite `ensure_installed` with the new value.
-- If you'd rather extend the default config, use the code below instead:
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add tsx and treesitter
vim.list_extend(opts.ensure_installed, {
"tsx",
"typescript",
})
end,
},
-- the opts function can also be used to change the default opts:
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function(_, opts)
table.insert(opts.sections.lualine_x, "😄")
end,
},
-- or you can return new options to override all the defaults
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
return {
--[[add your custom lualine config here]]
}
end,
},
-- use mini.starter instead of alpha
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
{ import = "lazyvim.plugins.extras.lang.json" },
-- add any tools you want to have installed below
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
}

View file

@ -0,0 +1,52 @@
return {
"echasnovski/mini.animate",
recommended = true,
event = "VeryLazy",
opts = function()
-- don't use animate when scrolling with the mouse
local mouse_scrolled = false
for _, scroll in ipairs({ "Up", "Down" }) do
local key = "<ScrollWheel" .. scroll .. ">"
vim.keymap.set({ "", "i" }, key, function()
mouse_scrolled = true
return key
end, { expr = true })
end
vim.api.nvim_create_autocmd("FileType", {
pattern = "grug-far",
callback = function()
vim.b.minianimate_disable = true
end,
})
LazyVim.toggle.map("<leader>ua", {
name = "Mini Animate",
get = function()
return not vim.g.minianimate_disable
end,
set = function(state)
vim.g.minianimate_disable = not state
end,
})
local animate = require("mini.animate")
return {
resize = {
timing = animate.gen_timing.linear({ duration = 50, unit = "total" }),
},
scroll = {
timing = animate.gen_timing.linear({ duration = 50, unit = "total" }),
subscroll = animate.gen_subscroll.equal({
predicate = function(total_scroll)
if mouse_scrolled then
mouse_scrolled = false
return false
end
return total_scroll > 1
end,
}),
},
}
end,
}

View file

@ -0,0 +1,33 @@
return {
"echasnovski/mini.files",
keys = {
{
"<leader>e",
function()
require("mini.files").open(vim.api.nvim_buf_get_name(0), true)
end,
desc = "Open mini.files (current file directory)",
},
{
"<leader>E",
function()
require("mini.files").open(vim.uv.cwd(), true)
end,
desc = "Open mini.files (cwd)",
},
{
"<leader>fm",
function()
require("mini.files").open(LazyVim.root(), true)
end,
desc = "Open mini.files (root)",
},
},
opts = {
mappings = {
go_in_plus = "<CR>",
-- go_out = "<BS>",
-- reset = "-",
},
},
}

View file

@ -0,0 +1,8 @@
return {
"folke/lazy.nvim",
opts = {
install = {
colorscheme = { "noirbuddy" },
},
},
}

View file

@ -0,0 +1,20 @@
-- local noirbuddy_lualine = require("noirbuddy.plugins.lualine")
return {
"nvim-lualine/lualine.nvim",
dependencies = {
"jesseleite/nvim-noirbuddy",
},
config = function()
local noirbuddy_lualine = require("noirbuddy.plugins.lualine")
local theme = noirbuddy_lualine.theme
local sections = noirbuddy_lualine.sections
local inactive_sections = noirbuddy_lualine.inactive_sections
require("lualine").setup({
options = {
theme = theme,
},
sections = sections,
inactive_sections = inactive_sections,
})
end,
}

View file

@ -0,0 +1,52 @@
-- return {
-- {
-- "nvim-neorg/neorg",
-- lazy = true, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
-- version = "*", -- Pin Neorg to the latest stable release
-- config = {
-- load = {
-- -- ["external.conceal-wrap"] = {},
-- -- ["external.context"] = {},
-- ["core.defaults"] = {},
-- ["core.concealer"] = {},
-- ["core.export"] = {},
-- ["core.export.markdown"] = {},
-- ["core.journal"] = {},
-- ["core.queries.native"] = {},
-- -- ["core.integrations.zen_mode"] = {},
-- -- ["core.presenter"] = {
-- -- config = {
-- -- zen_mode = "zen-mode",
-- -- },
-- -- },
-- ["core.summary"] = {},
-- ["core.text-objects"] = {},
-- -- ["core.latex.renderer"] = {},
-- ["core.completion"] = {
-- config = {
-- engine = "nvim-cmp",
-- },
-- },
-- ["core.keybinds"] = {
-- config = {
-- default_keybinds = true,
-- preset = "neorg",
-- },
-- },
-- ["core.dirman"] = {
-- config = {
-- workspaces = {
-- notes = "/home/fic/notes",
-- },
-- default_workspace = "notes",
-- index = "index.norg",
-- },
-- },
-- },
-- },
-- dependencies = {
-- -- "benlubas/neorg-conceal-wrap",
-- "max397574/neorg-contexts",
-- },
-- },
-- }

View file

@ -0,0 +1,48 @@
-- #0f0f0f
-- #933737
-- #A23D3D
-- #994848
-- #7B7F80
-- #7C8080
-- #8D8D8D
-- #d4d4d4
-- #949494
-- #933737
-- #A23D3D
-- #994848
-- #7B7F80
-- #7C8080
-- #8D8D8D
-- #d4d4d4
local noiropts = {
-- preset = "miami-nights",
colors = {
primary = "#994848",
secondary = "#933737",
-- background = "#0f0f0f",
diagnostic_error = "#EC0034",
diagnostic_warning = "#ff7700",
diagnostic_info = "#d5d5d5",
diagnostic_hint = "#f5f5f5",
diff_add = "#f5f5f5",
diff_change = "#737373",
diff_delete = "#EC0034",
},
}
return {
{
"jesseleite/nvim-noirbuddy",
lazy = false,
dependencies = {
{ "tjdevries/colorbuddy.nvim" },
},
},
{
"LazyVim/LazyVim",
opts = {
colorscheme = function()
require("noirbuddy").setup(noiropts)
end,
},
},
}

View file

@ -0,0 +1,14 @@
return {
{
"hrsh7th/nvim-cmp",
-- dependencies = {
-- "jesseleite/nvim-noirbuddy",
-- },
-- config = function()
-- require("cmp").setup({
-- window = require("noirbuddy.plugins.cmp").window,
-- })
-- end,
-- },
},
}

View file

@ -0,0 +1,19 @@
-- return {
-- "nvim-orgmode/orgmode",
-- event = "VeryLazy",
-- ft = { "org" },
-- config = function()
-- -- Setup orgmode
-- require("orgmode").setup({
-- org_agenda_files = "~/orgfiles/**/*",
-- org_default_notes_file = "~/orgfiles/refile.org",
-- })
--
-- -- NOTE: If you are using nvim-treesitter with ~ensure_installed = "all"~ option
-- -- add ~org~ to ignore_install
-- -- require('nvim-treesitter.configs').setup({
-- -- ensure_installed = 'all',
-- -- ignore_install = { 'org' },
-- -- })
-- end,
-- }

View file

@ -0,0 +1,117 @@
return {
"epwalsh/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
lazy = false,
-- lazy = true,
-- ft = "markdown",
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
event = {
-- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
-- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md"
-- refer to `:h file-pattern` for more examples
"BufReadPre /home/fic/second-brain/*.md",
"BufNewFile /home/fic/second-brain/*.md",
},
dependencies = {
-- Required.
"nvim-lua/plenary.nvim",
"epwalsh/pomo.nvim",
},
opts = {
workspaces = {
{
name = "second-brain",
path = "~/second-brain",
},
},
notes_subdir = "fleeting",
daily_notes = {
folder = "dailies",
date_format = "%Y-%m-%d",
alias_format = "%m %d %Y",
default_tags = { "daily_notes" },
template = nil,
},
completion = {
-- Set to false to disable completion.
nvim_cmp = true,
-- Trigger completion at 2 chars.
min_chars = 2,
},
mappings = {
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
["gf"] = {
action = function()
return require("obsidian").util.gf_passthrough()
end,
opts = { noremap = false, expr = true, buffer = true },
},
-- Toggle check-boxes.
["<leader>ch"] = {
action = function()
return require("obsidian").util.toggle_checkbox()
end,
opts = { buffer = true },
},
-- Smart action depending on context, either follow link or toggle checkbox.
["<cr>"] = {
action = function()
local o = require("obsidian").util
if o.cursor_on_markdown_link(nil, nil, true) then
return "<cmd>ObsidianFollowLink<CR>"
end
-- return require("obsidian").util.smart_action()
-- end,
end,
opts = { buffer = true, expr = true },
},
},
new_notes_location = "current_dir",
-- Optional, customize how note IDs are generated given an optional title.
---@param title string|?
---@return string
note_id_func = function(title)
-- Create note IDs in a Zettelkasten format with a timestamp and a suffix.
-- In this case a note with the title 'My new note' will be given an ID that looks
-- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'
local suffix = ""
if title ~= nil then
-- If title is given, transform it into valid file name.
suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
else
-- If title is nil, just add 4 random uppercase letters to the suffix.
for _ = 1, 4 do
suffix = suffix .. string.char(math.random(65, 90))
end
end
return tostring(os.time()) .. "-" .. suffix
end,
-- Optional, customize how note file names are generated given the ID, target directory, and title.
---@param spec { id: string, dir: obsidian.Path, title: string|? }
---@return string|obsidian.Path The full path to the new note.
note_path_func = function(spec)
-- This is equivalent to the default behavior.
local path
if spec.title then
path = spec.dir / tostring(spec.title)
else
path = spec.dir / tostring(spec.id)
end
return path:with_suffix(".md")
end,
templates = {
folder = "Utility/Templates",
date_format = "%M %d %Y",
time_format = "%H:%M",
-- A map for custom variables, the key should be the variable and the value a function
substitutions = {},
},
picker = {
name = "telescope.nvim",
},
search_max_lines = 1000,
-- open_notes_in = "vsplit",
},
}

View file

@ -0,0 +1,23 @@
return {
"stevearc/oil.nvim",
---@module 'oil'
---@type oil.SetupOpts
opts = {
default_file_explorer = true,
delete_to_trash = true,
columns = {
"icon",
"size",
-- TODO:
-- Add a keybind to toggle permissions view?
-- There's a recipe for this in the docs
-- "permissions",
},
keymaps = {
-- ["<BS>"] = "actions.parent",
},
},
-- Optional dependencies
dependencies = { { "echasnovski/mini.icons", opts = {} } },
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if prefer nvim-web-devicons
}

View file

@ -0,0 +1 @@
return { "nvim-treesitter/playground" }

View file

@ -0,0 +1,25 @@
return {
"folke/twilight.nvim",
opts = {
{
dimming = {
alpha = 0.25, -- amount of dimming
-- we try to get the foreground from the highlight groups or fallback color
color = { "Normal", "#ffffff" },
term_bg = "#000000", -- if guibg=NONE, this will be used to calculate text color
inactive = false, -- when true, other windows will be fully dimmed (unless they contain the same buffer)
},
context = 20, -- amount of lines we will try to show around the current line
treesitter = true, -- use treesitter when available for the filetype
-- treesitter is used to automatically expand the visible text,
-- but you can further control the types of nodes that should always be fully expanded
expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types
"function",
"method",
"table",
"if_statement",
},
exclude = {}, -- exclude these filetypes
},
},
}

View file

@ -0,0 +1,9 @@
return {
"psliwka/vim-dirtytalk",
build = ":DirtytalkUpdate",
config = function()
vim.opt.spelllang = { "en", "programming" }
end,
-- Note: let g:dirtytalk_blacklist=['lorem-ipsum'] to disable a wordlist
-- Mus run :DirtytalkUpdate after making this change
}

View file

@ -0,0 +1,4 @@
return {
"christoomey/vim-tmux-navigator",
lazy = false,
}

View file

@ -0,0 +1,24 @@
return {
"folke/zen-mode.nvim",
opts = {
window = {
options = {
signcolumn = "no",
-- number = false,
-- relativenumber = false,
-- cursorline = false,
foldcolumn = "0",
list = false,
},
},
plugins = {
options = {},
twilight = { enabled = false },
kitty = {
enabled = false,
-- enabled = true,
font = "+4",
},
},
},
}