nixos: gen 101 @ lilac — 2026-10-22 13:04 26.05.20260918.cf9d2fb (Yarara) ----- updating nvim and tmux for better keybinds.
This commit is contained in:
+33
-1
@@ -31,6 +31,10 @@ in
|
|||||||
vim.opt.foldmethod = "indent"
|
vim.opt.foldmethod = "indent"
|
||||||
vim.opt.foldlevel = 99
|
vim.opt.foldlevel = 99
|
||||||
|
|
||||||
|
-- nvim-tree replaces netrw; disable it up front so it never flashes.
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.keymap.set("n", "<leader>w", "<cmd>w<CR>", { silent = true })
|
vim.keymap.set("n", "<leader>w", "<cmd>w<CR>", { silent = true })
|
||||||
vim.keymap.set("n", "<leader>q", "<cmd>q<CR>", { silent = true })
|
vim.keymap.set("n", "<leader>q", "<cmd>q<CR>", { silent = true })
|
||||||
@@ -53,6 +57,7 @@ in
|
|||||||
view = { width = 30 },
|
view = { width = 30 },
|
||||||
renderer = { group_empty = true },
|
renderer = { group_empty = true },
|
||||||
filters = { dotfiles = false },
|
filters = { dotfiles = false },
|
||||||
|
update_focused_file = { enable = true },
|
||||||
})
|
})
|
||||||
|
|
||||||
require("bufferline").setup({
|
require("bufferline").setup({
|
||||||
@@ -72,6 +77,33 @@ in
|
|||||||
options = { theme = "auto" },
|
options = { theme = "auto" },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- <leader>e: open the explorer if closed, focus it if open elsewhere,
|
||||||
|
-- close it if it already has focus.
|
||||||
|
local tree = require("nvim-tree.api").tree
|
||||||
|
vim.keymap.set("n", "<leader>e", function()
|
||||||
|
if not tree.is_visible() then
|
||||||
|
tree.open()
|
||||||
|
elseif vim.bo.filetype == "NvimTree" then
|
||||||
|
tree.close()
|
||||||
|
else
|
||||||
|
tree.focus()
|
||||||
|
end
|
||||||
|
end, { silent = true, desc = "Toggle/focus file explorer" })
|
||||||
|
|
||||||
|
-- <leader>o / <leader>p: previous / next buffer in bufferline order
|
||||||
|
-- (left / right). From the explorer, hop back to the previous window
|
||||||
|
-- first so the tree window never gets a file loaded into it.
|
||||||
|
local function cycle(cmd)
|
||||||
|
return function()
|
||||||
|
if vim.bo.filetype == "NvimTree" then
|
||||||
|
vim.cmd("wincmd p")
|
||||||
|
end
|
||||||
|
vim.cmd(cmd)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
vim.keymap.set("n", "<leader>o", cycle("BufferLineCyclePrev"), { silent = true, desc = "Buffer left" })
|
||||||
|
vim.keymap.set("n", "<leader>p", cycle("BufferLineCycleNext"), { silent = true, desc = "Buffer right" })
|
||||||
|
|
||||||
require("neocord").setup({
|
require("neocord").setup({
|
||||||
logo = "auto",
|
logo = "auto",
|
||||||
logo_tooltip = "Neovim",
|
logo_tooltip = "Neovim",
|
||||||
@@ -238,7 +270,7 @@ in
|
|||||||
map("<leader>rn", vim.lsp.buf.rename)
|
map("<leader>rn", vim.lsp.buf.rename)
|
||||||
map("<leader>ca", vim.lsp.buf.code_action)
|
map("<leader>ca", vim.lsp.buf.code_action)
|
||||||
map("<leader>f", function() vim.lsp.buf.format({ async = true }) end)
|
map("<leader>f", function() vim.lsp.buf.format({ async = true }) end)
|
||||||
map("<leader>oi", require("jdtls").organize_imports)
|
map("<leader>ci", require("jdtls").organize_imports)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|||||||
+19
-2
@@ -3,6 +3,8 @@
|
|||||||
{
|
{
|
||||||
programs.tmux = {
|
programs.tmux = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
baseIndex = 1;
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
unbind C-b
|
unbind C-b
|
||||||
unbind '"'
|
unbind '"'
|
||||||
@@ -16,8 +18,8 @@
|
|||||||
set-window-option -g mode-keys vi
|
set-window-option -g mode-keys vi
|
||||||
set -g allow-passthrough on
|
set -g allow-passthrough on
|
||||||
set -s set-clipboard on
|
set -s set-clipboard on
|
||||||
set -g @resurrect-strategy-nvim 'session'
|
|
||||||
set -sg escape-time 10
|
set -sg escape-time 10
|
||||||
|
set -g renumber-windows on
|
||||||
|
|
||||||
bind -n M-h select-pane -L
|
bind -n M-h select-pane -L
|
||||||
bind -n M-j select-pane -D
|
bind -n M-j select-pane -D
|
||||||
@@ -32,11 +34,26 @@
|
|||||||
bind -n 'M-\' split-window -h -c "#{pane_current_path}"
|
bind -n 'M-\' split-window -h -c "#{pane_current_path}"
|
||||||
bind -n M-- split-window -v -c "#{pane_current_path}"
|
bind -n M-- split-window -v -c "#{pane_current_path}"
|
||||||
|
|
||||||
|
bind -n M-1 select-window -t :1
|
||||||
|
bind -n M-2 select-window -t :2
|
||||||
|
bind -n M-3 select-window -t :3
|
||||||
|
bind -n M-4 select-window -t :4
|
||||||
|
bind -n M-5 select-window -t :5
|
||||||
|
bind -n M-6 select-window -t :6
|
||||||
|
bind -n M-7 select-window -t :7
|
||||||
|
bind -n M-8 select-window -t :8
|
||||||
|
bind -n M-9 select-window -t :9
|
||||||
|
|
||||||
bind -n M-s copy-mode
|
bind -n M-s copy-mode
|
||||||
'';
|
'';
|
||||||
|
|
||||||
plugins = with pkgs.tmuxPlugins; [
|
plugins = with pkgs.tmuxPlugins; [
|
||||||
resurrect
|
{
|
||||||
|
plugin = resurrect;
|
||||||
|
extraConfig = ''
|
||||||
|
set -g @resurrect-strategy-nvim 'session'
|
||||||
|
'';
|
||||||
|
}
|
||||||
{
|
{
|
||||||
plugin = continuum;
|
plugin = continuum;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user