summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/custom-neovim')
-rw-r--r--pkgs/custom-neovim/config/init.lua6
-rw-r--r--pkgs/custom-neovim/config/lua/mappings.lua18
-rw-r--r--pkgs/custom-neovim/config/lua/options.lua4
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/lspconfig.lua4
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/mini/files.lua20
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/oil.lua11
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/persisted.lua1
-rw-r--r--pkgs/custom-neovim/default.nix1
-rw-r--r--pkgs/custom-neovim/design.md10
9 files changed, 61 insertions, 14 deletions
diff --git a/pkgs/custom-neovim/config/init.lua b/pkgs/custom-neovim/config/init.lua
index b30173b..6419790 100644
--- a/pkgs/custom-neovim/config/init.lua
+++ b/pkgs/custom-neovim/config/init.lua
@@ -13,11 +13,12 @@ require("mappings")
-- UI Plugins:
require("plugins.lualine")
require("plugins.tabby")
-require("plugins.snacks")
require("plugins.mini.clue")
require("plugins.mini.indentscope")
require("plugins.mini.notify")
require("plugins.treesitter")
+-- require("plugins.oil")
+require("plugins.mini.files")
-- LSP Plugins:
require("plugins.lspconfig")
@@ -25,4 +26,5 @@ require("plugins.actions-preview")
-- Misc Plugins:
require("plugins.presence")
-require("hardtime").setup()
+require("plugins.snacks")
+-- require("hardtime").setup()
diff --git a/pkgs/custom-neovim/config/lua/mappings.lua b/pkgs/custom-neovim/config/lua/mappings.lua
index 39f2bd3..9043096 100644
--- a/pkgs/custom-neovim/config/lua/mappings.lua
+++ b/pkgs/custom-neovim/config/lua/mappings.lua
@@ -7,7 +7,6 @@ vim.g.mapleader = ' '
-- Pickers
mapkey("n", "<leader>f", "Open file picker", ":lua Snacks.picker.files()<cr>")
mapkey("n", "<leader>l", "Open recent file picker", ":lua Snacks.picker.recent()<cr>")
-mapkey("n", "<leader>e", "Open file explorer", ":lua Snacks.picker.explorer()<cr>")
mapkey("n", "<leader>b", "Open buffer picker", ":lua Snacks.picker.buffers()<cr>")
mapkey("n", "<leader>B", "Open buffer live grep picker", ":lua Snacks.picker.grep_buffers()<cr>")
mapkey("n", "<leader>y", "Open clipboard history picker", ":lua Snacks.picker.cliphist()<cr>")
@@ -31,14 +30,20 @@ mapkey("n", "<leader>tp", "Go to previous tab", ":tabprev<cr>")
-- Sessions
mapkey("n", "<leader>s", "Manage sessions", "")
-mapkey("n", "<leader>ss", "Open session picker", ":SessionSelect<cr>")
+mapkey("n", "<leader>sw", "Save current session", ":SessionSave<cr>")
+mapkey("n", "<leader>ss", "Switch and save session", ":SessionSave<cr> <bar> :SessionSelect<cr>")
+mapkey("n", "<leader>sp", "Open session picker", ":SessionSelect<cr>")
+mapkey("n", "<leader>sd", "Delete current session", ":SessionDelete<cr>")
+mapkey("n", "<leader>sl", "Open last session", ":SessionLoadLast<cr>")
-- Terminals
mapkey("n", "<leader>c", "Manage terminals", "")
-- Git
-mapkey("n", "<leader>g", "Manage git", "")
-mapkey("n", "<leader>gg", "Open lazygit", ":lua Snacks.lazygit()<cr>")
+mapkey("n", "<leader>g", "Open lazygit", ":lua Snacks.lazygit()<cr>")
+
+-- Other leader keys
+mapkey("n", "<leader>e", "Open file manager", ":lua MiniFiles.open()<cr>")
-- QOL Keys
mapkey("t", "<Esc><Esc>", "Exit terminal insert mode", "<C-\\><C-n>")
@@ -47,10 +52,11 @@ vim.keymap.set("c", "<cr>", function()
return '<cr>'
end, { expr = true }) -- Make enter complete command.
mapkey("n", "<esc>", "Clear highlights", ":noh<cr>") -- Make esc clear highlights
+mapkey("n", "<leader>q", "Close buffer", ":bd<cr>")
-- Visual Movement Keys.
-mapkey({"n", "v"}, "j", "Go down visually", "gj")
-mapkey({"n", "v"}, "k", "Go up visually", "gk")
+-- mapkey({"n", "v"}, "j", "Go down visually", "gj")
+-- mapkey({"n", "v"}, "k", "Go up visually", "gk")
-- Learn hjkl.
-- mapkey({"n", "v"}, "<left>", "Correct the keypress", function() print("Try pressing h instead.") end)
diff --git a/pkgs/custom-neovim/config/lua/options.lua b/pkgs/custom-neovim/config/lua/options.lua
index cd59941..f2ffcc9 100644
--- a/pkgs/custom-neovim/config/lua/options.lua
+++ b/pkgs/custom-neovim/config/lua/options.lua
@@ -7,7 +7,8 @@ vim.o.ruler = false -- don't show #,# in the commandline.
vim.o.icm = 'split'
vim.o.cia = 'abbr,kind,menu'
vim.o.mouse = ""
-vim.o.relativenumber = true -- set numbered lines
+vim.o.number = true -- set absolute numbered lines
+vim.o.relativenumber = true -- set relative numbered lines
vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor
vim.o.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time
vim.o.clipboard = "unnamedplus" -- use system clipboard
@@ -39,4 +40,3 @@ vim.o.foldexpr = "v:lua.vim.treesitter.foldexpr()" -- Set folder to treesitter.
vim.o.foldlevel = 99 -- Don't fold initially.
vim.o.foldnestmax = 4 -- Don't fold if more than 4 folds deep.
vim.o.foldtext = "" -- Color text in folds.
-
diff --git a/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua b/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua
index 850ebe5..a18b80d 100644
--- a/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua
@@ -1,5 +1,3 @@
--- vim.keymap.set('n', '<space>d', vim.diagnostic.setloclist, {desc = "Add buffer diagnostics to the location list."})
-
-- Disable semantic tokens to stop weird highlighting.
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(ev)
@@ -40,7 +38,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
mapkey("n", "<leader>S", "Open workspace symbol picker", ":lua Snacks.picker.lsp_workspace_symbols()<cr>")
-- LSP Pickers
- mapkey({'n', 'v'}, "<leader>a", "Perform code action", require("actions-preview").code_actions)
+ mapkey('n', "<leader>a", "Perform code action", require("actions-preview").code_actions)
mapkey("n", "<leader>D", "Open workspace diagnostic picker", ":lua Snacks.picker.diagnostics()<cr>")
mapkey("n", "<leader>d", "Open diagnostic picker", [[:lua Snacks.picker.diagnostics_buffer()<cr>]])
diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/files.lua b/pkgs/custom-neovim/config/lua/plugins/mini/files.lua
new file mode 100644
index 0000000..e64aefa
--- /dev/null
+++ b/pkgs/custom-neovim/config/lua/plugins/mini/files.lua
@@ -0,0 +1,20 @@
+require("mini.files").setup {
+ mappings = {
+ close = '<esc>',
+ go_in = 'l',
+ go_in_plus = 'L',
+ go_out = 'h',
+ go_out_plus = 'H',
+ mark_goto = "'",
+ mark_set = 'm',
+ reset = '<BS>',
+ reveal_cwd = '@',
+ show_help = 'g?',
+ synchronize = '=',
+ trim_left = '<',
+ trim_right = '>',
+ },
+ windows = {
+ preview = true,
+ },
+}
diff --git a/pkgs/custom-neovim/config/lua/plugins/oil.lua b/pkgs/custom-neovim/config/lua/plugins/oil.lua
new file mode 100644
index 0000000..6682599
--- /dev/null
+++ b/pkgs/custom-neovim/config/lua/plugins/oil.lua
@@ -0,0 +1,11 @@
+require('oil').setup {
+ win_options = {
+ wrap = true,
+ },
+ skip_confirm_for_simple_edits = true,
+ watch_for_changes = true,
+ float = {
+ max_width = 0.6,
+ max_height = 0.8,
+ },
+}
diff --git a/pkgs/custom-neovim/config/lua/plugins/persisted.lua b/pkgs/custom-neovim/config/lua/plugins/persisted.lua
index 6f0273e..043c130 100644
--- a/pkgs/custom-neovim/config/lua/plugins/persisted.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/persisted.lua
@@ -1,3 +1,4 @@
require("persisted").setup {
autostart = true,
+ autoload = true,
}
diff --git a/pkgs/custom-neovim/default.nix b/pkgs/custom-neovim/default.nix
index 85099f8..6b78fde 100644
--- a/pkgs/custom-neovim/default.nix
+++ b/pkgs/custom-neovim/default.nix
@@ -21,6 +21,7 @@ in
alpha-nvim # Dashboard.
persisted-nvim # Session manager.
snacks-nvim
+ oil-nvim
# Colorschemes
oxocarbon-nvim # IBM Carbon themes.
diff --git a/pkgs/custom-neovim/design.md b/pkgs/custom-neovim/design.md
index 1bdefb3..d9d667e 100644
--- a/pkgs/custom-neovim/design.md
+++ b/pkgs/custom-neovim/design.md
@@ -6,5 +6,13 @@
- Searchable Keybinds
- Which-key (or something similar)
- Good terminal multiplexing
-- Start screen
- Sessions
+
+## Todo
+
+- Figure out good session management
+- install oil.nvim to replace default dir manager
+- Configure snacks terminal manager
+- add quick window switcher plugin
+- make vertical dividers the same color as text
+