summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkgs/custom-neovim/config/init.lua26
-rw-r--r--pkgs/custom-neovim/config/lua/mappings.lua2
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/focus.lua10
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/incline.lua3
-rw-r--r--pkgs/custom-neovim/default.nix2
-rw-r--r--pkgs/custom-neovim/design.md12
-rw-r--r--pkgs/custom-neovim/git-plugins.nix10
7 files changed, 58 insertions, 7 deletions
diff --git a/pkgs/custom-neovim/config/init.lua b/pkgs/custom-neovim/config/init.lua
index 9d21de2..cd5e09b 100644
--- a/pkgs/custom-neovim/config/init.lua
+++ b/pkgs/custom-neovim/config/init.lua
@@ -1,3 +1,29 @@
+local should_profile = os.getenv("NVIM_PROFILE")
+if should_profile then
+ require("profile").instrument_autocmds()
+ if should_profile:lower():match("^start") then
+ require("profile").start("*")
+ else
+ require("profile").instrument("*")
+ end
+end
+
+local function toggle_profile()
+ local prof = require("profile")
+ if prof.is_recording() then
+ prof.stop()
+ vim.ui.input({ prompt = "Save profile to:", completion = "file", default = "profile.json" }, function(filename)
+ if filename then
+ prof.export(filename)
+ vim.notify(string.format("Wrote %s", filename))
+ end
+ end)
+ else
+ prof.start("*")
+ end
+end
+vim.keymap.set("", "<f1>", toggle_profile)
+
-- Require utilities.
require("utilities")
require("art")
diff --git a/pkgs/custom-neovim/config/lua/mappings.lua b/pkgs/custom-neovim/config/lua/mappings.lua
index 569ad25..b763d05 100644
--- a/pkgs/custom-neovim/config/lua/mappings.lua
+++ b/pkgs/custom-neovim/config/lua/mappings.lua
@@ -33,7 +33,7 @@ mapkey("n", "<leader>b", "Manage buffers", "")
mapkey("n", "<leader>bb", "Go to next buffer", ":bn<cr>")
mapkey("n", "<leader>bB", "Go to previous buffer", ":bp<cr>")
mapkey("n", "<leader>bd", "Delete current buffer", ":bd<cr>")
-mapkey("n", "<leader>bd", "Force delete current buffer", ":bd!<cr>")
+mapkey("n", "<leader>bD", "Force delete current buffer", ":bd!<cr>")
mapkey("n", "<leader>bp", "Open buffer picker", ":lua Snacks.picker.buffers()<cr>")
mapkey("n", "<leader>bg", "Open buffer live grep picker", ":lua Snacks.picker.grep_buffers()<cr>")
mapkey("n", "<leader>bc", "Clear invisible buffers", function ()
diff --git a/pkgs/custom-neovim/config/lua/plugins/focus.lua b/pkgs/custom-neovim/config/lua/plugins/focus.lua
index 915603e..560f3ce 100644
--- a/pkgs/custom-neovim/config/lua/plugins/focus.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/focus.lua
@@ -1,10 +1,18 @@
require("focus").setup {
enable = true,
split = {
- bufnew = true,
+ -- bufnew = true,
},
ui = {
winhighlight = true, -- Highlight focused and unfocused windows
signcolumn = false, -- Signcolumn on all windows
+ -- cursorline = false,
},
}
+
+vim.api.nvim_create_autocmd("WinEnter", {
+ pattern = "picker",
+ callback = function(args)
+ vim.b[args.buf].cursorline = false
+ end,
+})
diff --git a/pkgs/custom-neovim/config/lua/plugins/incline.lua b/pkgs/custom-neovim/config/lua/plugins/incline.lua
index b17a9c9..92ced03 100644
--- a/pkgs/custom-neovim/config/lua/plugins/incline.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/incline.lua
@@ -1,5 +1,8 @@
local icons = require 'mini.icons'
require('incline').setup {
+ hide = {
+ only_win = true,
+ },
window = {
padding = 0,
margin = { horizontal = 0 },
diff --git a/pkgs/custom-neovim/default.nix b/pkgs/custom-neovim/default.nix
index 8ea087c..479e952 100644
--- a/pkgs/custom-neovim/default.nix
+++ b/pkgs/custom-neovim/default.nix
@@ -28,6 +28,8 @@ in
render-markdown-nvim # Render markdown fancily.
incline-nvim # Puts the filename in the winbar.
+ git-plugins.profile-nvim-git
+
# Completion
nvim-cmp # Completer.
cmp-buffer
diff --git a/pkgs/custom-neovim/design.md b/pkgs/custom-neovim/design.md
index 85cbf7c..4dba97e 100644
--- a/pkgs/custom-neovim/design.md
+++ b/pkgs/custom-neovim/design.md
@@ -10,15 +10,17 @@
## Todo
-- Switch from dropbar to incline
- make lazyvim launch with default shell bash
-- make mini tabline compatible with more colorschemes
- add quick window switch plugin
-- switch to maple mono font
-- add force buffer delete key
-- profile and optimize
+- replace nvim-cmp with blink.cmp
+- add markview
+- make statusline cwd depend on the neovim window and not focused window
+- add key to open new session
+- make clearing buffers reload the tab bar
+- add keybind to go to the previous file (maybe <leader>L)
## Todo if possible
+- switch to maple mono font
- make splits automatically equalize when window resized
- prevent dropbar filename from truncating
- make mini.git run commands from cwd instead of git root
diff --git a/pkgs/custom-neovim/git-plugins.nix b/pkgs/custom-neovim/git-plugins.nix
index a956923..adc7403 100644
--- a/pkgs/custom-neovim/git-plugins.nix
+++ b/pkgs/custom-neovim/git-plugins.nix
@@ -27,4 +27,14 @@
sha256 = "sha256-ywKb/VVNSa/LtiQaSO2lqff2ujupIcc9P9AJg/p6mKw=";
};
};
+ profile-nvim-git = pkgs.vimUtils.buildVimPlugin {
+ name = "profiler-nvim";
+ version = "git";
+ src = pkgs.fetchFromGitHub {
+ owner = "stevearc";
+ repo = "profile.nvim";
+ rev = "30433d7513f0d14665c1cfcea501c90f8a63e003";
+ sha256 = "sha256-2Mk6VbC+K/WhTWF+yHyDhQKJhTi2rpo8VJsnO7ofHXs=";
+ };
+ };
}