diff --git a/.chezmoiexternal.yaml b/.chezmoiexternal.yaml index e2985a3..7fc29e5 100644 --- a/.chezmoiexternal.yaml +++ b/.chezmoiexternal.yaml @@ -5,12 +5,6 @@ url: "https://raw.githubusercontent.com/zsh-users/antigen/master/bin/antigen.zsh" refreshPeriod: 168h -# neovim packer -.local/share/nvim/site/pack/packer/start/packer.nvim: - type: git-repo - url: "https://github.com/wbthomason/packer.nvim" - refreshPeriod: 168h - # tmux plugin manager .config/tmux/plugins/tpm: type: git-repo diff --git a/dot_config/nvim/after/plugin/bufferline.lua b/dot_config/nvim/after/plugin/bufferline.lua new file mode 100644 index 0000000..c561909 --- /dev/null +++ b/dot_config/nvim/after/plugin/bufferline.lua @@ -0,0 +1,46 @@ +require("bufferline").setup({ + highlights = require("catppuccin.groups.integrations.bufferline").get(), + options = { + show_close_icon = false, + separator_style = "thin", + show_buffer_close_icons = false, + offsets = { { filetype = "NvimTree" } }, + left_mouse_command = "buffer %d", + middle_mouse_command = "bdelete! %d", + right_mouse_command = nil, + }, +}) + +local nmap = function(key, cmd) + vim.api.nvim_set_keymap("n", key, cmd, { noremap = true, silent = true }) +end + +-- hop between buffers in order of the bar +nmap("", "BufferLineCyclePrev") +nmap("", "BufferLineCycleNext") +-- Re-order to previous/next +nmap("", "BufferLineMovePrev") +nmap(">", "BufferLineMoveNext") +-- Goto buffer in position... +nmap("", "BufferLineGoToBuffer 1") +nmap("", "BufferLineGoToBuffer 2") +nmap("", "BufferLineGoToBuffer 3") +nmap("", "BufferLineGoToBuffer 4") +nmap("", "BufferLineGoToBuffer 5") +nmap("", "BufferLineGoToBuffer 6") +nmap("", "BufferLineGoToBuffer 7") +nmap("", "BufferLineGoToBuffer 8") +nmap("", "BufferLineGoToBuffer 9") +nmap("", "BufferLineGoToBuffer -1") +-- Pin/unpin buffer +nmap("", "BufferLineTogglePin") +-- Close buffer +nmap("", "bdelete") +nmap("", "bdelete!") +-- create new buffer +nmap("", "enew") +-- pick buffer +nmap("", "BufferLinePick") +-- Sort automatically by... +nmap("bd", "BufferLineSortByDirectory") +nmap("bl", "BufferLineSortByExtension") diff --git a/dot_config/nvim/lua/config/catppuccin.lua b/dot_config/nvim/after/plugin/catppuccin.lua similarity index 96% rename from dot_config/nvim/lua/config/catppuccin.lua rename to dot_config/nvim/after/plugin/catppuccin.lua index 1cc9bdd..36aff33 100644 --- a/dot_config/nvim/lua/config/catppuccin.lua +++ b/dot_config/nvim/after/plugin/catppuccin.lua @@ -32,12 +32,10 @@ require("catppuccin").setup({ lsp_saga = true, lsp_trouble = true, nvimtree = { - enabled = false, + enabled = true, }, neotree = { - enabled = true, - show_root = false, - transparent_panel = false, + enabled = false, }, which_key = true, indent_blankline = { @@ -100,7 +98,7 @@ require("catppuccin").setup({ mantle = "#020202", }, }, - transparent_background = false, + transparent_background = true, }) vim.api.nvim_command("colorscheme catppuccin") diff --git a/dot_config/nvim/lua/config/colorizer.lua b/dot_config/nvim/after/plugin/colorizer.lua similarity index 96% rename from dot_config/nvim/lua/config/colorizer.lua rename to dot_config/nvim/after/plugin/colorizer.lua index 52118ee..095e6bf 100644 --- a/dot_config/nvim/lua/config/colorizer.lua +++ b/dot_config/nvim/after/plugin/colorizer.lua @@ -17,7 +17,6 @@ require("colorizer").setup({ buftypes = { "*", "!dashboard", - "!packer", "!popup", "!prompt", }, diff --git a/dot_config/nvim/lua/config/copilot.lua b/dot_config/nvim/after/plugin/copilot.lua similarity index 61% rename from dot_config/nvim/lua/config/copilot.lua rename to dot_config/nvim/after/plugin/copilot.lua index 534d488..cc3fdc3 100644 --- a/dot_config/nvim/lua/config/copilot.lua +++ b/dot_config/nvim/after/plugin/copilot.lua @@ -24,14 +24,3 @@ require("copilot").setup({ copilot_node_command = "node", server_opts_overrides = {}, }) - --- local present, cmp = pcall(require, "cmp") --- if not present or not cmp then --- return --- end --- cmp.event:on("menu_opened", function() --- vim.b.copilot_suggestion_hidden = true --- end) --- cmp.event:on("menu_closed", function() --- vim.b.copilot_suggestion_hidden = false --- end) diff --git a/dot_config/nvim/lua/config/dashboard.lua b/dot_config/nvim/after/plugin/dashboard.lua similarity index 52% rename from dot_config/nvim/lua/config/dashboard.lua rename to dot_config/nvim/after/plugin/dashboard.lua index b86fd23..52e6801 100644 --- a/dot_config/nvim/lua/config/dashboard.lua +++ b/dot_config/nvim/after/plugin/dashboard.lua @@ -1,4 +1,7 @@ -local db = require("dashboard") +local present, db = pcall(require, "dashboard") +if not present then + return +end db.custom_header = function() local cringe = { @@ -8,27 +11,27 @@ db.custom_header = function() } local random_cringe = cringe[math.random(#cringe)] return { - [[╭──────────────────────────────────────────────────╮]], - [[│⠀⠀⠀⠀⠀⠀⡏⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣄⢧⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⢰⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠘⣄⠀⠀⠀⠀⢹⣦⠀⠀⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠘⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⡄⠀⠀⠀⠈⠙⣧⡀⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢻⠀⠀⠀⠀⢸⡼⣇⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⢿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠖⠀⠀⡸⠀⠀⠀⡟⠈⠃⣿⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⢺⡇⠀⠀⠀⠀⠀⠀⣀⣶⣶⠀⠀⠀⠀⠀⣠⣶⣶⣶⣶⣦⣤⣀⣀⣤⡶⠶⠶⠶⡇⠀⠀⣼⣿⣶⠀⣿⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⠈⣷⠀⠀⠀⣠⣾⣿⣿⣿⣿⢿⠀⠀⠀⠘⢻⠙⠛⠒⠛⠛⢉⣩⠁⠀⠀⢀⡄⠀⡇⠀⢀⣿⡿⠛⠀⣿⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⠀⠘⣆⠀⠈⠉⠁⣉⣉⣃⠞⣠⠀⠀⠀⠀⠀⠀⠀⠈⠙⠛⠉⠁⠀⠀⠀⡾⠀⡀⠁⠀⠈⣿⠁⠀⣸⠇⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⠐⠀⠀⠀⠀⠀⠀⠃⠀⠀⠀⠀⠀⠀⢤⣀⡀⠀⠀⠀⠀⠀⠀⠀⣦⢱⠀⠀⠀⢿⣀⣠⠏⠀⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⠀⠀⠀⠀⠀⣰⡾⠃⠀⠀⠀⠀⠀⣀⣠⡿⠀⠀⣤⣄⡀⠀⠀⠀⠸⣄⠀⠀⠀⢳⡝⢯⡀⠀⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡀⠀⠀⠀⣰⡟⠑⠦⠴⣤⣤⣤⣾⡛⠁⠀⠀⠀⠀⠈⢷⠀⠀⠀⠀⢿⡄⠀⠀⠀⣿⡆⠙⣆⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⠀⠀⣿⠀⠀⢠⣤⣤⣄⢉⣨⣥⣶⠶⢶⣾⠶⠂⠘⠦⢤⣤⣠⡾⠃⠀⠀⠀⣿⠀⠀⠘⣦⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣇⠀⣀⠀⠈⠀⠐⢿⣏⠉⠉⠉⢉⣁⣠⡶⠟⠁⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⣠⣾⡟⠀⠀⠀⠘⢧⣀⡀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡄⠈⠀⠂⠀⠀⠀⠈⠉⢉⣉⣩⡭⠓⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⡿⠀⠀⠀⠀⠀⠀⠉⠉⠑⠒│]], - [[│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣨⠟⠀⡁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣾⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡴⠋⠀⠀⡠⠇⢠⣀⠀⠀⠀⠀⠀⠀⠠⠐⠂⠀⠀⢀⣠⣼⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│]], - [[│⠀⠀⠀⣀⣀⡠⠤⠶⠛⠁⠀⠀⠀⠈⠀⠀⠀⠛⢷⣤⣀⣀⠀⠀⠀⠀⢀⣠⣴⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│]], - [[│⣤⠞⠋⠉⠀⡀⠀⠀⣀⡀⠀⠀⠀⠀⠀⠀⣤⣄⠘⣿⣿⣟⠛⠿⣷⣿⣿⣿⣿⣿⣿⣿⣿⣯⣿⣦⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│]], - [[╰──────────────────────────────────────────────────╯]], + [[╔══════════════════════════════════════════════════╗]], + [[║⠀⠀⠀⠀⠀⠀⡏⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣄⢧⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⢰⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠘⣄⠀⠀⠀⠀⢹⣦⠀⠀⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠘⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⡄⠀⠀⠀⠈⠙⣧⡀⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢻⠀⠀⠀⠀⢸⡼⣇⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⢿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠖⠀⠀⡸⠀⠀⠀⡟⠈⠃⣿⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⢺⡇⠀⠀⠀⠀⠀⠀⣀⣶⣶⠀⠀⠀⠀⠀⣠⣶⣶⣶⣶⣦⣤⣀⣀⣤⡶⠶⠶⠶⡇⠀⠀⣼⣿⣶⠀⣿⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⠈⣷⠀⠀⠀⣠⣾⣿⣿⣿⣿⢿⠀⠀⠀⠘⢻⠙⠛⠒⠛⠛⢉⣩⠁⠀⠀⢀⡄⠀⡇⠀⢀⣿⡿⠛⠀⣿⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⠀⠘⣆⠀⠈⠉⠁⣉⣉⣃⠞⣠⠀⠀⠀⠀⠀⠀⠀⠈⠙⠛⠉⠁⠀⠀⠀⡾⠀⡀⠁⠀⠈⣿⠁⠀⣸⠇⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⠐⠀⠀⠀⠀⠀⠀⠃⠀⠀⠀⠀⠀⠀⢤⣀⡀⠀⠀⠀⠀⠀⠀⠀⣦⢱⠀⠀⠀⢿⣀⣠⠏⠀⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⠀⠀⠀⠀⠀⣰⡾⠃⠀⠀⠀⠀⠀⣀⣠⡿⠀⠀⣤⣄⡀⠀⠀⠀⠸⣄⠀⠀⠀⢳⡝⢯⡀⠀⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡀⠀⠀⠀⣰⡟⠑⠦⠴⣤⣤⣤⣾⡛⠁⠀⠀⠀⠀⠈⢷⠀⠀⠀⠀⢿⡄⠀⠀⠀⣿⡆⠙⣆⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⠀⠀⣿⠀⠀⢠⣤⣤⣄⢉⣨⣥⣶⠶⢶⣾⠶⠂⠘⠦⢤⣤⣠⡾⠃⠀⠀⠀⣿⠀⠀⠘⣦⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣇⠀⣀⠀⠈⠀⠐⢿⣏⠉⠉⠉⢉⣁⣠⡶⠟⠁⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⣠⣾⡟⠀⠀⠀⠘⢧⣀⡀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡄⠈⠀⠂⠀⠀⠀⠈⠉⢉⣉⣩⡭⠓⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⡿⠀⠀⠀⠀⠀⠀⠉⠉⠑⠒║]], + [[║⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣨⠟⠀⡁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣾⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡴⠋⠀⠀⡠⠇⢠⣀⠀⠀⠀⠀⠀⠀⠠⠐⠂⠀⠀⢀⣠⣼⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀║]], + [[║⠀⠀⠀⣀⣀⡠⠤⠶⠛⠁⠀⠀⠀⠈⠀⠀⠀⠛⢷⣤⣀⣀⠀⠀⠀⠀⢀⣠⣴⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀║]], + [[║⣤⠞⠋⠉⠀⡀⠀⠀⣀⡀⠀⠀⠀⠀⠀⠀⣤⣄⠘⣿⣿⣟⠛⠿⣷⣿⣿⣿⣿⣿⣿⣿⣿⣯⣿⣦⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀║]], + [[╚══════════════════════════════════════════════════╝]], random_cringe, } end @@ -77,10 +80,8 @@ db.custom_center = { db.custom_footer = function() local v = vim.version() local vStr = string.format("%d.%d.%d", v.major, v.minor, v.patch) - local plugCount = #vim.tbl_keys(packer_plugins) return { "masochism " .. vStr, - plugCount .. " regrets", } end diff --git a/dot_config/nvim/after/plugin/feline.lua b/dot_config/nvim/after/plugin/feline.lua new file mode 100644 index 0000000..b671155 --- /dev/null +++ b/dot_config/nvim/after/plugin/feline.lua @@ -0,0 +1,50 @@ +local ctp_present, clrs = pcall(require, "catppuccin.palettes") +local _, ctp_feline = pcall(require, "catppuccin.groups.integrations.feline") +local present, feline = pcall(require, "feline") + +if not present then + return +end + +if ctp_present then + clrs = clrs.get_palette("catppuccin") + ctp_feline.setup({ + assets = { + left_separator = "", + right_separator = "", + bar = "█", + mode_icon = " ", + dir = "  ", + file = "  ", + git = { + branch = " ", + }, + }, + sett = { + show_modified = true, + curr_dir = clrs.mauve, + curr_file = clrs.blue, + bkg = clrs.crust, + }, + mode_colors = { + ["n"] = { "NORMAL", clrs.blue }, + }, + }) +end + +feline.setup({ + components = ctp_feline.get(), + force_inactive = { + filetypes = { + "^startify$", + "^fugitive$", + "^fugitiveblame$", + "^qf$", + "^help$", + }, + buftypes = { + "^terminal$", + }, + bufnames = {}, + }, +}) diff --git a/dot_config/nvim/lua/config/gitsigns.lua b/dot_config/nvim/after/plugin/gitsigns.lua similarity index 96% rename from dot_config/nvim/lua/config/gitsigns.lua rename to dot_config/nvim/after/plugin/gitsigns.lua index 8581d68..a787268 100644 --- a/dot_config/nvim/lua/config/gitsigns.lua +++ b/dot_config/nvim/after/plugin/gitsigns.lua @@ -1,9 +1,12 @@ -local wk = require("which-key") +local p1, wk = pcall(require, "which-key") +local p2, gs = pcall(require, "gitsigns") -require("gitsigns").setup({ +if not (p1 and p2) then + return +end + +gs.setup({ on_attach = function(bufnr) - local gs = package.loaded.gitsigns - -- Gitsigns wk.register({ ["h"] = { diff --git a/dot_config/nvim/after/plugin/indent_blankline.lua b/dot_config/nvim/after/plugin/indent_blankline.lua new file mode 100644 index 0000000..33212fc --- /dev/null +++ b/dot_config/nvim/after/plugin/indent_blankline.lua @@ -0,0 +1,11 @@ +require("indent_blankline").setup({ + space_char_blankline = " ", +}) +vim.g.indent_blankline_filetype_exclude = { + "dashboard", + "help", + "neogitstatus", + "fugitive", + "NvimTree", + "Trouble", +} diff --git a/dot_config/nvim/lua/lsp.lua b/dot_config/nvim/after/plugin/lsp.lua similarity index 99% rename from dot_config/nvim/lua/lsp.lua rename to dot_config/nvim/after/plugin/lsp.lua index e4eba8a..78ff692 100644 --- a/dot_config/nvim/lua/lsp.lua +++ b/dot_config/nvim/after/plugin/lsp.lua @@ -25,10 +25,10 @@ local has_words_before = function() ---@diagnostic disable-next-line: deprecated local line, col = unpack(vim.api.nvim_win_get_cursor(0)) return col ~= 0 - and vim.api - .nvim_buf_get_lines(0, line - 1, line, true)[1] - :sub(col, col) - :match("%s") + and vim.api + .nvim_buf_get_lines(0, line - 1, line, true)[1] + :sub(col, col) + :match("%s") == nil end diff --git a/dot_config/nvim/after/plugin/lspsaga.lua b/dot_config/nvim/after/plugin/lspsaga.lua new file mode 100644 index 0000000..4f73118 --- /dev/null +++ b/dot_config/nvim/after/plugin/lspsaga.lua @@ -0,0 +1,23 @@ +local saga = require("lspsaga") +saga.init_lsp_saga({ + code_action_lightbulb = { + enable = false, + }, +}) + +local nmap = function(key, cmd) + vim.api.nvim_set_keymap("n", key, cmd, { noremap = true, silent = true }) +end + +nmap("gr", "Lspsaga rename") +nmap("gx", "Lspsaga code_action") +nmap("gx", ":Lspsaga range_code_action") +nmap("K", "Lspsaga hover_doc") +nmap("go", "Lspsaga show_line_diagnostics") +nmap("gj", "Lspsaga diagnostic_jump_next") +nmap("gk", "Lspsaga diagnostic_jump_prev") + +vim.cmd([[ + nnoremap lua require('lspsaga.floaterm').open_float_terminal() + tnoremap :lua require('lspsaga.floaterm').close_float_terminal() +]]) diff --git a/dot_config/nvim/lua/config/presence.lua b/dot_config/nvim/after/plugin/presence.lua similarity index 64% rename from dot_config/nvim/lua/config/presence.lua rename to dot_config/nvim/after/plugin/presence.lua index ddee60b..97667d7 100644 --- a/dot_config/nvim/lua/config/presence.lua +++ b/dot_config/nvim/after/plugin/presence.lua @@ -1,3 +1,9 @@ +local present, presence = pcall(require, "presence") + +if not present then + return +end + function string.starts(self, str) return self:find("^" .. str) ~= nil end @@ -10,11 +16,14 @@ local blacklist = { } local function get_chezmoi_output() - local sp = io.popen("chezmoi managed -i files") + local sp, err = io.popen("chemoi managed -i files -pa") + if err then + return nil + end if sp then local files = {} for line in sp:lines() do - table.insert(files, vim.fn.expand("$HOME") .. "/" .. line) + table.insert(files, line) end sp:close() return files @@ -23,7 +32,7 @@ end local chezmoi_managed = get_chezmoi_output() -local conceal = function() +local conceal = function(activity, info) local cur_file = vim.fn.expand("%:p") if vim.tbl_contains(chezmoi_managed, cur_file) then return "Managing dotfiles" @@ -33,13 +42,15 @@ local conceal = function() return v end end - return false + if info ~= nil then + return activity .. " " .. info + end end local v = vim.version() local vStr = string.format("v%d.%d.%d", v.major, v.minor, v.patch) -require("presence"):setup({ +presence:setup({ -- General options auto_update = true, debounce_timeout = 10, @@ -49,39 +60,12 @@ require("presence"):setup({ show_time = false, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches ---@diagnostic disable-next-line: unused-local - buttons = function(buffer, repo_url) - -- ignore where no repo_url is set - if repo_url == nil then - return false - end - - -- only show certain org/user repos, don't leak clients or work - local visible_urls = { - "github.com/catppuccin", - "github.com/farbenfroh", - "github.com/nekowinston", - } - - -- check if repo_url is in the list of visible urls - for _, visible_url in ipairs(visible_urls) do - if repo_url:find(visible_url) then - return { - { - label = "Steal the code", - url = repo_url, - }, - } - end - end - - -- if not, make funni - return { - { - label = "Steal the code", - url = "https://winston.sh/rrproductions/studio.git", - }, - } - end, + buttons = { + { + label = "Steal the code", + url = "https://git.winston.sh/winston/holy-grail.git", + }, + }, file_assets = { ["k8s.yaml"] = { "Kubernetes", @@ -110,25 +94,13 @@ require("presence"):setup({ }, -- Rich Presence text options editing_text = function(s) - local concealed = conceal() - if concealed then - return concealed - end - return "Editing " .. s + return conceal("Editing", s) end, reading_text = function(s) - local concealed = conceal() - if concealed then - return concealed - end - return "Reading " .. s + return conceal("Reading", s) end, file_explorer_text = function(s) - local concealed = conceal() - if concealed then - return concealed - end - return "Browsing " .. s + return conceal("Browsing", s) end, workspace_text = function(s) local concealed = conceal() diff --git a/dot_config/nvim/lua/config/telescope.lua b/dot_config/nvim/after/plugin/telescope.lua similarity index 84% rename from dot_config/nvim/lua/config/telescope.lua rename to dot_config/nvim/after/plugin/telescope.lua index 28d8474..fec58c9 100644 --- a/dot_config/nvim/lua/config/telescope.lua +++ b/dot_config/nvim/after/plugin/telescope.lua @@ -21,7 +21,7 @@ easypick.setup({ pickers = { { name = "chezmoi", - command = [[chezmoi managed -x encrypted -i files | awk '{ printf("%s/%s\n", "~", $0) }']], + command = [[chezmoi managed -ifiles -pabsolute -xencrypted]], previewer = easypick.previewers.default() }, } diff --git a/dot_config/nvim/lua/config/treesitter.lua b/dot_config/nvim/after/plugin/treesitter.lua similarity index 93% rename from dot_config/nvim/lua/config/treesitter.lua rename to dot_config/nvim/after/plugin/treesitter.lua index c2d37cd..0f4a311 100644 --- a/dot_config/nvim/lua/config/treesitter.lua +++ b/dot_config/nvim/after/plugin/treesitter.lua @@ -1,7 +1,6 @@ require("nvim-treesitter.configs").setup({ auto_install = true, ignore_install = { - -- woulnd't install sometimes, not needed "phpdoc", }, highlight = { diff --git a/dot_config/nvim/lua/config/which-key.lua b/dot_config/nvim/after/plugin/which-key.lua similarity index 86% rename from dot_config/nvim/lua/config/which-key.lua rename to dot_config/nvim/after/plugin/which-key.lua index cce36d0..f491e63 100644 --- a/dot_config/nvim/lua/config/which-key.lua +++ b/dot_config/nvim/after/plugin/which-key.lua @@ -16,12 +16,13 @@ wk.setup({ wk.register({ ["f"] = { name = "+Telescope", - d = { "Telescope find_files", "Find File" }, - r = { "Telescope asynctasks all", "Run Asynctasks" }, b = { "Telescope file_browser", "File Browser" }, + c = { "Easypick chezmoi", "Chezmoi" }, + d = { "Telescope find_files", "Find File" }, g = { "Telescope live_grep", "Live Grep" }, h = { "Telescope help_tags", "Help Tags" }, p = { "Telescope project", "Project" }, + r = { "Telescope asynctasks all", "Run Asynctasks" }, s = { function() local confpath = vim.fn.resolve(vim.fn.stdpath("config")) @@ -37,6 +38,10 @@ wk.register({ [""] = { y = { '"+y', "Copy to clipboard" }, p = { '"+p', "Paste from clipboard" }, + db = { "DBUIToggle", "Toggle DBUI" }, + gd = { "Gvdiff!", "Git Diff" }, + ng = { "Neogit", "Neogit" }, + sl = { "SessionLoad", "Load Session" }, }, }, { mode = { "n", "v" } }) diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index 00e5e1b..44070af 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1,15 +1,15 @@ -- vim:fdm=marker pcall(require, "impatient") -pcall(require, "plugins") -pcall(require, "lsp") +vim.g.mapleader = " " +-- netrw is handled by nvim-tree +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 -- true colors vim.o.termguicolors = true --- map leader to space -vim.g.mapleader = " " vim.o.cmdheight = 0 -- line numbers -vim.o.mouse = "" +vim.o.mouse = "nv" vim.o.number = true vim.o.relativenumber = true -- scroll offsets @@ -30,81 +30,14 @@ vim.o.splitright = true vim.o.wrap = false -- redefine word boundaries - '_' is a word seperator, this helps with snake_case vim.opt.iskeyword:remove("_") - --- netrw is handled by nvim-tree -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 - -function Map(mode, shortcut, command, opt) - opt = opt or { noremap = true, silent = true } - vim.keymap.set(mode, shortcut, command, opt) -end - --- easier split navigation -Map("n", "", "j") -Map("n", "", "k") -Map("n", "", "l") -Map("n", "", "h") -Map("n", "\\", ":vsplit") -Map("n", "-", ":split") -Map("n", "x", ":q") --- merge conflicts -Map("n", "gd", ":Gvdiff!") -Map("n", "gd", ":diffget") -Map("n", "gdh", ":diffget //2") -Map("n", "gdl", ":diffget //3") --- clipboard -Map({ "n", "v" }, "p", '"+p') -Map({ "n", "v" }, "y", '"+y') --- escape :terminal easier -vim.cmd([[tnoremap ]]) - -- indentations settings vim.o.shiftwidth = 2 vim.o.tabstop = 2 vim.o.softtabstop = 0 vim.o.expandtab = true -vim.cmd([[ -autocmd FileType html,lua,css,js,jsreact,ts,tsreact,json,yaml setlocal ts=2 sw=2 sts=0 et -autocmd FileType go setlocal ts=4 sw=4 sts=4 noet -autocmd FileType python,rust setlocal ts=4 sw=4 sts=4 et -autocmd FileType markdown let g:table_mode_corner='|' -]]) -local builtins = { - "2html_plugin", - "bugreport", - "compiler", - "ftplugin", - "fzf", - "getscript", - "getscriptPlugin", - "gzip", - "logipat", - "matchit", - "netrw", - "netrwFileHandlers", - "netrwPlugin", - "netrwSettings", - "optwin", - "rplugin", - "rrhelper", - "spellfile_plugin", - "synmenu", - "syntax", - "tar", - "tarPlugin", - "tutor", - "vimball", - "vimballPlugin", - "zip", - "zipPlugin", -} - --- disable builtin plugins -for _, plugin in pairs(builtins) do - vim.g["loaded_" .. plugin] = 1 -end +pcall(require, "plugins") +pcall(require, "binds") vim.api.nvim_create_autocmd("VimResized", { pattern = "*", diff --git a/dot_config/nvim/lazy-lock.json b/dot_config/nvim/lazy-lock.json new file mode 100644 index 0000000..a5954f0 --- /dev/null +++ b/dot_config/nvim/lazy-lock.json @@ -0,0 +1,70 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "5f01c1a89adafc52bf34e3bf690f80d9d726715d" }, + "asyncrun.vim": { "branch": "master", "commit": "ea59f760c223100edcffc52ffe019f502a792039" }, + "asynctasks.vim": { "branch": "master", "commit": "784a4b1f75a913cc6c43dd6c4dbe69d648dbbfa5" }, + "bufferline.nvim": { "branch": "main", "commit": "4ecfa81e470a589e74adcde3d5bb1727dd407363" }, + "catppuccin": { "branch": "main", "commit": "55f43a952856bc0029e6cef066297c6cfab3451d" }, + "chezmoi.vim": { "branch": "main", "commit": "df01e4108be9f2e4092cd753ebfb46d04e6e47ce" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, + "cmp-git": { "branch": "main", "commit": "fae6cdb407ad6c63a0b1928670bad1a67a55b887" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "59224771f91b86d1de12570b4070fe4ad7cd1eeb" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, + "copilot.lua": { "branch": "master", "commit": "81eb5d1bc2eddad5ff0b4e3c1c4be5c09bdfaa63" }, + "easypick.nvim": { "branch": "main", "commit": "08390110ef1ceb15507a98c2dc984880890b5810" }, + "editorconfig.nvim": { "branch": "master", "commit": "2af880947129f1ab776b732a4eecb92528472ef5" }, + "feline.nvim": { "branch": "master", "commit": "573e6d1e213de976256c84e1cb2f55665549b828" }, + "fidget.nvim": { "branch": "main", "commit": "44585a0c0085765195e6961c15529ba6c5a2a13b" }, + "friendly-snippets": { "branch": "main", "commit": "1a6a02350568d6830bcfa167c72f9b6e75e454ae" }, + "gitsigns.nvim": { "branch": "main", "commit": "2ab3bdf0a40bab53033048c6be75bda86316b55d" }, + "go.nvim": { "branch": "master", "commit": "5cefc346e7f3955b90a7d53157e5db6b9258c510" }, + "guihua.lua": { "branch": "master", "commit": "2f8939599ef04057dee6504724a2ff04fe12d758" }, + "impatient.nvim": { "branch": "main", "commit": "9f7eed8133d62457f7ad2ca250eb9b837a4adeb7" }, + "indent-blankline.nvim": { "branch": "master", "commit": "c4c203c3e8a595bc333abaf168fcb10c13ed5fb7" }, + "lazy.nvim": { "branch": "main", "commit": "fd1fbefc3df2b8e92209ed932144edc49877c41e" }, + "lightspeed.nvim": { "branch": "main", "commit": "299eefa6a9e2d881f1194587c573dad619fdb96f" }, + "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, + "lspsaga.nvim": { "branch": "main", "commit": "b7b4777369b441341b2dcd45c738ea4167c11c9e" }, + "ltex-extra.nvim": { "branch": "master", "commit": "c5046a6eabfee378f781029323efd941fcc53483" }, + "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "5bea0e851b8f48479d2cb927cd26733b4058b2b3" }, + "mason.nvim": { "branch": "main", "commit": "28408c857a8f821ff504c9383c96af22b7ca66d9" }, + "neogit": { "branch": "master", "commit": "0d6002c6af432343937283fb70791fc76fa7227c" }, + "null-ls.nvim": { "branch": "main", "commit": "ef9010b2ac11e2068a8e1d5a4eff576289a1f9a4" }, + "nvim-autopairs": { "branch": "master", "commit": "b5994e6547d64f781cfca853a1aa6174d238fe0e" }, + "nvim-cmp": { "branch": "main", "commit": "8868cf9a09e5f3c2612a22ccb82dcc6d9f0d0d35" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "760e27df4dd966607e8fb7fd8b6b93e3c7d2e193" }, + "nvim-dap": { "branch": "master", "commit": "6f2ea9e33b48a51849ec93c6c38148a5372018e4" }, + "nvim-dap-ui": { "branch": "master", "commit": "54365d2eb4cb9cfab0371306c6a76c913c5a67e3" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "2971ce3e89b1711cc26e27f73d3f854b559a77d4" }, + "nvim-lspconfig": { "branch": "master", "commit": "5292d60976b3084a987bf5634150f6201830ac18" }, + "nvim-surround": { "branch": "main", "commit": "6cc6b54d3728a17e34bb5c9b9db05c7e5690813d" }, + "nvim-tree.lua": { "branch": "master", "commit": "e14c2895b4f36a22001f7773244041c173dcf867" }, + "nvim-treesitter": { "branch": "master", "commit": "e8b765bee1f760b0153fb4edf2391ff5d7a85475" }, + "nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" }, + "nvim-ts-rainbow": { "branch": "master", "commit": "064fd6c0a15fae7f876c2c6dd4524ca3fad96750" }, + "nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" }, + "playground": { "branch": "master", "commit": "3421bbbfec25a7c54ee041ffb9cb226b69b2b995" }, + "plenary.nvim": { "branch": "master", "commit": "4b7e52044bbb84242158d977a50c4cbcd85070c7" }, + "presence.nvim": { "branch": "main", "commit": "c1c54758824cbecd4e18065d37191f7666fdd097" }, + "py_lsp.nvim": { "branch": "main", "commit": "9b549141d2d66f7c73902d511c543713171610d6" }, + "rust-tools.nvim": { "branch": "master", "commit": "99fd1238c6068d0637df30b6cee9a264334015e9" }, + "schemastore.nvim": { "branch": "main", "commit": "d1625bb74b3a7f84aad278a7968f4496ae8936c6" }, + "stabilize.nvim": { "branch": "master", "commit": "34069870a8e72632c5447188e638e1c6bfebc353" }, + "telescope-asynctasks.nvim": { "branch": "main", "commit": "065300fb0a8ba6a1c81991da1873c73e136dcdc0" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "cad567e11131a01f2934930c1efc8b1b09a0dc56" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "fab3e2212e206f4f8b3bbaa656e129443c9b802e" }, + "telescope-project.nvim": { "branch": "master", "commit": "ff4d3cea905383a67d1a47b9dd210c4907d858c2" }, + "telescope.nvim": { "branch": "master", "commit": "e960efa60e97df58e089b00270f09d60f27202c8" }, + "true-zen.nvim": { "branch": "main", "commit": "98740c76254c65576ec294551028b65081053588" }, + "vim-astro": { "branch": "main", "commit": "34732be5e9a5c28c2409f4490edf92d46d8b55a9" }, + "vim-dadbod": { "branch": "master", "commit": "34151ccce9f5ff16229b8e482a97e46997914cb3" }, + "vim-dadbod-completion": { "branch": "master", "commit": "e71eb6140556c5ced80de6299a1fdfe22bd3c1b1" }, + "vim-dadbod-ui": { "branch": "master", "commit": "6a2b841d2f0b82386c637ce4e9954ae12c7eaee8" }, + "vim-fugitive": { "branch": "master", "commit": "5b0b138483de17a8fd8dfcec0b491782c8fbf102" }, + "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, + "vim-table-mode": { "branch": "master", "commit": "9555a3e6e5bcf285ec181b7fc983eea90500feb4" }, + "vim-vsnip": { "branch": "master", "commit": "8dde8c0ef10bb1afdbb301e2bd7eb1c153dd558e" }, + "which-key.nvim": { "branch": "main", "commit": "61553aeb3d5ca8c11eea8be6eadf478062982ac9" } +} \ No newline at end of file diff --git a/dot_config/nvim/lua/binds.lua b/dot_config/nvim/lua/binds.lua new file mode 100644 index 0000000..4dea3db --- /dev/null +++ b/dot_config/nvim/lua/binds.lua @@ -0,0 +1,22 @@ +function map(mode, shortcut, command, opt) + opt = opt or { noremap = true, silent = true } + vim.keymap.set(mode, shortcut, command, opt) +end + +-- easier split navigation +map("n", "", "j") +map("n", "", "k") +map("n", "", "l") +map("n", "", "h") +map("n", "\\", ":vsplit") +map("n", "-", ":split") +map("n", "x", ":q") +-- merge conflicts +map("n", "gd", ":diffget") +map("n", "gdh", ":diffget //2") +map("n", "gdl", ":diffget //3") +-- escape :terminal easier +map("t", "", "") + +-- NvimTree +map("n", "", ":NvimTreeToggle") diff --git a/dot_config/nvim/lua/config/bufferline.lua b/dot_config/nvim/lua/config/bufferline.lua deleted file mode 100644 index 3092134..0000000 --- a/dot_config/nvim/lua/config/bufferline.lua +++ /dev/null @@ -1,41 +0,0 @@ -require("bufferline").setup({ - highlights = require("catppuccin.groups.integrations.bufferline").get(), - options = { - show_close_icon = false, - separator_style = "thin", - show_buffer_close_icons = false, - offsets = { { filetype = "NvimTree" } }, - left_mouse_command = "buffer %d", - middle_mouse_command = "bdelete! %d", - right_mouse_command = nil, - }, -}) --- hop between buffers in order of the bar -Map("n", "", "BufferLineCyclePrev") -Map("n", "", "BufferLineCycleNext") --- Re-order to previous/next -Map("n", "", "BufferLineMovePrev") -Map("n", ">", "BufferLineMoveNext") --- Goto buffer in position... -Map("n", "", "BufferLineGoToBuffer 1") -Map("n", "", "BufferLineGoToBuffer 2") -Map("n", "", "BufferLineGoToBuffer 3") -Map("n", "", "BufferLineGoToBuffer 4") -Map("n", "", "BufferLineGoToBuffer 5") -Map("n", "", "BufferLineGoToBuffer 6") -Map("n", "", "BufferLineGoToBuffer 7") -Map("n", "", "BufferLineGoToBuffer 8") -Map("n", "", "BufferLineGoToBuffer 9") -Map("n", "", "BufferLineGoToBuffer -1") --- Pin/unpin buffer -Map("n", "", "BufferLineTogglePin") --- Close buffer -Map("n", "", "bdelete") -Map("n", "", "bdelete!") --- create new buffer -Map("n", "", "enew") --- pick buffer -Map("n", "", "BufferLinePick") --- Sort automatically by... -Map("n", "bd", "BufferLineSortByDirectory") -Map("n", "bl", "BufferLineSortByExtension") diff --git a/dot_config/nvim/lua/config/feline.lua b/dot_config/nvim/lua/config/feline.lua deleted file mode 100644 index c470b88..0000000 --- a/dot_config/nvim/lua/config/feline.lua +++ /dev/null @@ -1,43 +0,0 @@ -local clrs = require("catppuccin.palettes.init").get_palette() -local ctp_feline = require("catppuccin.groups.integrations.feline") - -ctp_feline.setup({ - assets = { - left_separator = "", - right_separator = "", - bar = "█", - mode_icon = " ", - dir = "  ", - file = "  ", - git = { - branch = " ", - }, - }, - sett = { - show_modified = true, - curr_dir = clrs.mauve, - curr_file = clrs.blue, - bkg = clrs.crust, - }, - mode_colors = { - ["n"] = { "NORMAL", clrs.blue }, - }, -}) - -require("feline").setup({ - components = ctp_feline.get(), - force_inactive = { - filetypes = { - "^packer$", - "^startify$", - "^fugitive$", - "^fugitiveblame$", - "^qf$", - "^help$", - }, - buftypes = { - "^terminal$", - }, - bufnames = {}, - }, -}) diff --git a/dot_config/nvim/lua/config/lspsaga.lua b/dot_config/nvim/lua/config/lspsaga.lua deleted file mode 100644 index 663023a..0000000 --- a/dot_config/nvim/lua/config/lspsaga.lua +++ /dev/null @@ -1,22 +0,0 @@ -local saga = require("lspsaga") -saga.init_lsp_saga({ - symbol_in_winbar = { - in_custom = true, - }, - code_action_lightbulb = { - enable = false, - }, -}) - -Map("n", "gr", "Lspsaga rename") -Map("n", "gx", "Lspsaga code_action") -Map("n", "gx", ":Lspsaga range_code_action") -Map("n", "K", "Lspsaga hover_doc") -Map("n", "go", "Lspsaga show_line_diagnostics") -Map("n", "gj", "Lspsaga diagnostic_jump_next") -Map("n", "gk", "Lspsaga diagnostic_jump_prev") - -vim.cmd([[ - nnoremap lua require('lspsaga.floaterm').open_float_terminal() - tnoremap :lua require('lspsaga.floaterm').close_float_terminal() -]]) diff --git a/dot_config/nvim/lua/plugins.lua b/dot_config/nvim/lua/plugins.lua index 2633b21..ff9b985 100644 --- a/dot_config/nvim/lua/plugins.lua +++ b/dot_config/nvim/lua/plugins.lua @@ -1,335 +1,222 @@ -local packer = require("packer") +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", "clone", "--filter=blob:none", "--single-branch", + "https://github.com/folke/lazy.nvim.git", lazypath + }) +end +vim.opt.runtimepath:prepend(lazypath) --- auto-compile when lua files in `~/.config/nvim/*` change -vim.api.nvim_create_autocmd("BufWritePost", { - pattern = "*.lua", - callback = function() - local cfg_path = vim.fn.resolve(vim.fn.stdpath("config")) - vim.defer_fn(function() - if vim.fn.expand("%:p"):match(cfg_path) then - vim.cmd("silent! PackerCompile") - end - end, 0) - end, -}) - -return packer.startup({ - function(use) - -- Packer managing itself - use("wbthomason/packer.nvim") - -- startup time or some shit - use("lewis6991/impatient.nvim") - - -- colour scheme - use({ - "https://git.winston.sh/catppuccin/nvim", - as = "catppuccin", - config = function() - require("config/catppuccin") - end, - }) - - use({ - "Pocco81/true-zen.nvim", - config = function() - require("true-zen").setup() - end, - }) - - -- git gutter - use({ - "lewis6991/gitsigns.nvim", - config = function() - require("config/gitsigns") - end, - }) - -- rainbow indents - use({ - "lukas-reineke/indent-blankline.nvim", - config = function() - require("indent_blankline").setup({ - space_char_blankline = " ", - -- show_current_context = true, - -- show_current_context_start = true, - }) - vim.g.indent_blankline_filetype_exclude = { - "dashboard", - "help", - "neogitstatus", - "fugitive", - "packer", - "NvimTree", - "Trouble", - } - end, - }) - - use({ - "akinsho/bufferline.nvim", - config = function() - require("config/bufferline") - end, - }) - - use({ - "feline-nvim/feline.nvim", - config = function() - require("config/feline") - end, - }) - - -- DJI Osmo - use({ - "luukvbaal/stabilize.nvim", - config = function() - require("stabilize").setup() - end, - }) - - -- syntax - use({ - "nvim-treesitter/nvim-treesitter", - run = function() - require("nvim-treesitter.install").update({ with_sync = true }) - end, - config = function() - require("config/treesitter") - end, - }) - use("nvim-treesitter/playground") - - use({ - "p00f/nvim-ts-rainbow", - requires = "nvim-treesitter/nvim-treesitter", - }) - - -- show possible key combos - use({ - "folke/which-key.nvim", - config = function() - require("config/which-key") - end, - }) - - -- syntax - use("alker0/chezmoi.vim") - use({ - "wuelnerdotexe/vim-astro", - config = function() - vim.g.astro_typescript = "enable" - end, - }) - -- tooling - use("gpanders/editorconfig.nvim") - -- read and write encrypted pgp files - use("jamessan/vim-gnupg") - - -- additional functionality - use({ - "numToStr/Comment.nvim", - config = function() - require("Comment").setup() - end, - }) - use({ - "kylechui/nvim-surround", - config = function() - require("nvim-surround").setup({}) - end, - }) - use("ggandor/lightspeed.nvim") - - use({ - "windwp/nvim-autopairs", - config = function() - require("nvim-autopairs").setup({}) - local cmp_autopairs = require("nvim-autopairs.completion.cmp") - local cmp = require("cmp") - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) - end, - }) - use({ - "windwp/nvim-ts-autotag", - config = function() - require("nvim-ts-autotag").setup() - end, - }) - - -- git - use({ - "tpope/vim-fugitive", - }) - -- why not both? - use({ - "TimUntersberger/neogit", - requires = "nvim-lua/plenary.nvim", - config = function() - Map("n", "ng", "Neogit") - end, - }) - use("dhruvasagar/vim-table-mode") - use({ - "nvchad/nvim-colorizer.lua", - config = function() - require("config/colorizer") - end, - }) - - -- databases - use("tpope/vim-dadbod") - use("kristijanhusak/vim-dadbod-completion") - use({ - "kristijanhusak/vim-dadbod-ui", - config = function() - Map("n", "db", ":DBUIToggle") - vim.g.db_ui_use_nerd_fonts = true - vim.g.db_ui_win_position = "right" - end, - }) - - -- telescope - use({ - "nvim-telescope/telescope.nvim", - requires = "nvim-lua/plenary.nvim", - config = function() - require("config/telescope") - end, - }) - use({ - "nvim-telescope/telescope-fzf-native.nvim", - run = "make", - requires = "nvim-telescope/telescope.nvim", - }) - use({ - "nvim-telescope/telescope-file-browser.nvim", - config = function() - require("telescope").load_extension("file_browser") - end, - }) - use({ - "nvim-telescope/telescope-project.nvim", - config = function() - require("telescope").load_extension("project") - end, - }) - use({ - "axkirillov/easypick.nvim", - requires = "nvim-telescope/telescope.nvim", - }) - - use("nvim-tree/nvim-web-devicons") - use({ - "nvim-tree/nvim-tree.lua", - keys = { "" }, - config = function() - Map("n", "", ":NvimTreeToggle") - require("nvim-tree").setup() - end, - }) - - use({ - "andweeb/presence.nvim", - config = function() - require("config/presence") - end, - }) - use({ "iamcco/markdown-preview.nvim", run = "cd app && yarn install" }) - - -- LSP - use("williamboman/mason.nvim") - use("williamboman/mason-lspconfig.nvim") - use("neovim/nvim-lspconfig") - -- completion - use("hrsh7th/nvim-cmp") - use("hrsh7th/cmp-buffer") - use("hrsh7th/cmp-cmdline") - use("hrsh7th/cmp-nvim-lsp") - use("hrsh7th/cmp-path") - use("hrsh7th/cmp-vsnip") - use("hrsh7th/vim-vsnip") - use("petertriho/cmp-git") - use("onsails/lspkind.nvim") - use("rafamadriz/friendly-snippets") - use("jose-elias-alvarez/null-ls.nvim") - use({ - "glepnir/lspsaga.nvim", - branch = "main", - config = function() - require("config/lspsaga") - end, - }) - use({ - "ray-x/go.nvim", - requires = "ray-x/guihua.lua", - }) - use({ - "HallerPatrick/py_lsp.nvim", - }) - use({ - "simrat39/rust-tools.nvim", - }) - - use({ - "rcarriga/nvim-dap-ui", - requires = { - "mfussenegger/nvim-dap", - "theHamsta/nvim-dap-virtual-text", - }, - }) - - use({ "barreiroleo/ltex-extra.nvim" }) - - use("b0o/schemastore.nvim") - use({ - "zbirenbaum/copilot.lua", - config = function() - require("config/copilot") - end, - }) - - -- organization - use({ - "vimwiki/vimwiki", - branch = "dev", - config = function() - vim.g.vimwiki_global_ext = 0 - vim.g.vimwiki_list = { - { - auto_export = 1, - path = "~/.local/share/vimwiki/", - syntax = "markdown", - ext = ".md", - path_html = "~/vimwiki/", - template_path = "~/.config/vimwiki/templates/", - template_default = "default", - template_ext = ".tpl", - custom_wiki2html = "vimwiki_markdown", - html_filename_parameterization = 1, - }, - } - end, - }) - use("tools-life/taskwiki") - - use({ - "skywind3000/asyncrun.vim", - config = function() - vim.g.asyncrun_open = 6 - end, - }) - use({ "skywind3000/asynctasks.vim" }) - use({ - "GustavoKatel/telescope-asynctasks.nvim", - config = function() - require("telescope").load_extension("asynctasks") - end, - }) - end, - config = { - display = { - open_fn = function() - return require("packer.util").float({ border = "double" }) - end, - }, +local plugins = { + -- startup time or some shit + "lewis6991/impatient.nvim", + -- colour scheme + { "catppuccin/nvim", name = "catppuccin" }, + "glepnir/dashboard-nvim", + "Pocco81/true-zen.nvim", + -- git gutter + "lewis6991/gitsigns.nvim", + -- rainbow indents + "lukas-reineke/indent-blankline.nvim", + "akinsho/bufferline.nvim", + -- "feline-nvim/feline.nvim", + -- DJI Osmo + "luukvbaal/stabilize.nvim", + -- syntax + { + "nvim-treesitter/nvim-treesitter", + build = function() + require("nvim-treesitter.install").update({ with_sync = true }) + end, }, + "nvim-treesitter/playground", + "p00f/nvim-ts-rainbow", + -- show possible key combos + "folke/which-key.nvim", + -- syntax + "alker0/chezmoi.vim", + { + "wuelnerdotexe/vim-astro", + config = function() + vim.g.astro_typescript = "enable" + end, + }, + -- tooling + "gpanders/editorconfig.nvim", + -- read and write encrypted pgp files + "jamessan/vim-gnupg", + -- additional functionality + { + "numToStr/Comment.nvim", + config = function() + require("Comment").setup() + end + }, + { + "kylechui/nvim-surround", + config = function() + require("nvim-surround").setup() + end, + }, + "ggandor/lightspeed.nvim", + { + "windwp/nvim-autopairs", + config = function() + require("nvim-autopairs").setup() + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + local cmp = require("cmp") + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, + }, + "windwp/nvim-ts-autotag", + -- git + "tpope/vim-fugitive", + -- why not both? + "TimUntersberger/neogit", + { + "dhruvasagar/vim-table-mode", + config = function() + vim.cmd([[autocmd FileType markdown let g:table_mode_corner='|']]) + end + }, + "nvchad/nvim-colorizer.lua", + -- databases + "tpope/vim-dadbod", + "kristijanhusak/vim-dadbod-completion", + { + "kristijanhusak/vim-dadbod-ui", + config = function() + vim.g.db_ui_use_nerd_fonts = true + vim.g.db_ui_win_position = "right" + end, + }, + + "skywind3000/asyncrun.vim", + "skywind3000/asynctasks.vim", + + -- telescope + { + "nvim-telescope/telescope.nvim", + config = function() + local telescope = require("telescope") + telescope.load_extension("fzf") + telescope.load_extension("asynctasks") + telescope.load_extension("file_browser") + telescope.load_extension("project") + end, + dependencies = { + "nvim-lua/plenary.nvim", + { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + }, + "GustavoKatel/telescope-asynctasks.nvim", + "nvim-telescope/telescope-file-browser.nvim", + "nvim-telescope/telescope-project.nvim", + "axkirillov/easypick.nvim", + } + }, + + -- nvimtree + "nvim-tree/nvim-web-devicons", + { + "nvim-tree/nvim-tree.lua", + config = function() + require("nvim-tree").setup() + end + }, + + -- discord + "andweeb/presence.nvim", + { "iamcco/markdown-preview.nvim", build = "cd app && yarn install" }, + + -- LSP + { + "neovim/nvim-lspconfig", + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + -- completion + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-cmdline", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-path", + "hrsh7th/cmp-vsnip", + "hrsh7th/vim-vsnip", + "petertriho/cmp-git", + "onsails/lspkind.nvim", + "rafamadriz/friendly-snippets", + "jose-elias-alvarez/null-ls.nvim", + "glepnir/lspsaga.nvim", + { + "j-hui/fidget.nvim", + config = function() + require("fidget").setup({}) + end + }, + "barreiroleo/ltex-extra.nvim", + "b0o/schemastore.nvim", + "HallerPatrick/py_lsp.nvim", + "simrat39/rust-tools.nvim", + { "ray-x/go.nvim", dependencies = { "ray-x/guihua.lua" } }, + { "rcarriga/nvim-dap-ui", dependencies = { "mfussenegger/nvim-dap", "theHamsta/nvim-dap-virtual-text" } }, + } + }, + -- lua github copilot + "zbirenbaum/copilot.lua", +} + +require("lazy").setup(plugins, { + defaults = { lazy = false }, + install = { colorscheme = { "catppuccin" } }, + performance = { + rtp = { + disabled_plugins = { + "2html_plugin", + "bugreport", + "compiler", + "ftplugin", + "fzf", + "getscript", + "getscriptPlugin", + "gzip", + "logipat", + "matchit", + "netrw", + "netrwFileHandlers", + "netrwPlugin", + "netrwSettings", + "optwin", + "rplugin", + "rrhelper", + "spellfile_plugin", + "synmenu", + "syntax", + "tar", + "tarPlugin", + "tutor", + "vimball", + "vimballPlugin", + "zip", + "zipPlugin", + } + } + }, + ui = { + icons = { + cmd = " ", + config = "", + event = " ", + ft = " ", + init = " ", + keys = " ", + plugin = " ", + runtime = " ", + source = " ", + start = " ", + task = " ", + }, + border = "double" + } })