summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/custom-neovim')
-rw-r--r--pkgs/custom-neovim/config/lua/keymaps.lua2
-rw-r--r--pkgs/custom-neovim/config/lua/lsp.lua8
-rw-r--r--pkgs/custom-neovim/config/lua/statusline.lua15
-rw-r--r--pkgs/custom-neovim/default.nix1
-rw-r--r--pkgs/custom-neovim/todo.md4
5 files changed, 24 insertions, 6 deletions
diff --git a/pkgs/custom-neovim/config/lua/keymaps.lua b/pkgs/custom-neovim/config/lua/keymaps.lua
index 7ca0845..74366a2 100644
--- a/pkgs/custom-neovim/config/lua/keymaps.lua
+++ b/pkgs/custom-neovim/config/lua/keymaps.lua
@@ -21,8 +21,10 @@ mapkey("n", "<leader>e", "Open file manager", ":lua MiniFiles.open()<cr>", "mini
mapkey("n", "<leader>g", "Manage git", "")
mapkey("n", "<leader>gg", "Open neogit", ":Neogit<cr>", "neogit")
mapkey("n", "<leader>ga", "Git add", ":Git add %:p<cr>", "mini-git")
+mapkey("n", "<leader>gA", "Git add cwd", ":Git add "..vim.fn.getcwd().."/.<cr>", "mini-git")
mapkey("n", "<leader>gr", "Git remove", ":Git rm %:p<cr>", "mini-git")
mapkey("n", "<leader>gc", "Git commit", ":Git commit<cr>", "mini-git")
+mapkey("n", "<leader>gs", "Git status", ":Git status<cr>", "mini-git")
mapkey("n", "<leader>gp", "Git pull", ":Git pull<cr>", "mini-git")
mapkey("n", "<leader>gP", "Git push", ":Git push<cr>", "mini-git")
diff --git a/pkgs/custom-neovim/config/lua/lsp.lua b/pkgs/custom-neovim/config/lua/lsp.lua
index 68a4d3d..627b115 100644
--- a/pkgs/custom-neovim/config/lua/lsp.lua
+++ b/pkgs/custom-neovim/config/lua/lsp.lua
@@ -26,6 +26,14 @@ vim.lsp.config("marksman", {
})
vim.lsp.enable("marksman")
+-- Nixd LS
+vim.lsp.config("nixd", {
+ cmd = { 'nixd' },
+ filetypes = { 'nix' },
+ root_markers = { 'flake.nix', '.git' },
+})
+vim.lsp.enable("nixd")
+
-- LSP Autocommands
-- Disable semantic tokens to stop weird highlighting.
diff --git a/pkgs/custom-neovim/config/lua/statusline.lua b/pkgs/custom-neovim/config/lua/statusline.lua
index fd246ba..f5fb20f 100644
--- a/pkgs/custom-neovim/config/lua/statusline.lua
+++ b/pkgs/custom-neovim/config/lua/statusline.lua
@@ -234,14 +234,23 @@ components.tab_counter = function (args)
local before = args.before or ""
local after = args.after or ""
- local num_tabs = #vim.api.nvim_list_tabpages()
- local current_tab = vim.api.nvim_get_current_tabpage()
+ local tab_list = vim.api.nvim_list_tabpages()
+ local num_tabs = #tab_list
+ local current_tab_name = vim.api.nvim_get_current_tabpage()
+
+ local current_tab_index = 1
+
+ for i = 1, #tab_list, 1 do
+ if tab_list[i] == current_tab_name then
+ current_tab_index = i
+ end
+ end
if num_tabs == 1 then return "" end
local icon = use_icons and "󰓩 " or "tab: "
- return before..icon..current_tab.."/"..num_tabs..after
+ return before..icon..current_tab_index.."/"..num_tabs..after
end
-- Define Statusline
diff --git a/pkgs/custom-neovim/default.nix b/pkgs/custom-neovim/default.nix
index 0fe21b6..149ab12 100644
--- a/pkgs/custom-neovim/default.nix
+++ b/pkgs/custom-neovim/default.nix
@@ -51,6 +51,7 @@ inputs.mnw.lib.wrap pkgs {
# LSP Servers
lua-language-server
marksman
+ nixd
# Extra Utils
ripgrep
diff --git a/pkgs/custom-neovim/todo.md b/pkgs/custom-neovim/todo.md
index c2e47ab..8f2573e 100644
--- a/pkgs/custom-neovim/todo.md
+++ b/pkgs/custom-neovim/todo.md
@@ -4,7 +4,5 @@
- add git commands (add all and status)
- add zoxide plugin
- add markdown renderer
-- add tab management keys
- add spellcheck to markdown
-- fix current tab display
-
+- setup actions preview keybind