updates
This commit is contained in:
parent
f289c537d8
commit
ddb92ea0c5
12 changed files with 918 additions and 643 deletions
|
|
@ -1,8 +1,7 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
{ config
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
with builtins;
|
||||
with lib.attrsets;
|
||||
|
|
@ -25,17 +24,30 @@ let
|
|||
"cb" = "${pkgs.wl-clipboard-rs}/bin/wl-copy";
|
||||
"cat" = "${pkgs.bat}/bin/bat";
|
||||
|
||||
"pull" = "${pkgs.git}/bin/git pull";
|
||||
"push" = "${pkgs.git}/bin/git push";
|
||||
"commit" = "${pkgs.git}/bin/git commit";
|
||||
"add" = "${pkgs.git}/bin/git add";
|
||||
"patch" = "${pkgs.git}/bin/git add -p";
|
||||
"amend" = "${pkgs.git}/bin/git commit --amend";
|
||||
"log" = "${pkgs.git}/bin/git log --all --graph --decorate";
|
||||
"st" = "${pkgs.git}/bin/git status";
|
||||
"checkout" = "${pkgs.git}/bin/git checkout";
|
||||
"rebase" = "${pkgs.git}/bin/git rebase";
|
||||
"stash" = "${pkgs.git}/bin/git stash";
|
||||
# "pull" = "${pkgs.git}/bin/git pull";
|
||||
# "push" = "${pkgs.git}/bin/git push";
|
||||
# "commit" = "${pkgs.git}/bin/git commit";
|
||||
# "add" = "${pkgs.git}/bin/git add";
|
||||
# "patch" = "${pkgs.git}/bin/git add -p";
|
||||
# "amend" = "${pkgs.git}/bin/git commit --amend";
|
||||
# "log" = "${pkgs.git}/bin/git log --all --graph --decorate";
|
||||
# "st" = "${pkgs.git}/bin/git status";
|
||||
# "checkout" = "${pkgs.git}/bin/git checkout";
|
||||
# "rebase" = "${pkgs.git}/bin/git rebase";
|
||||
# "stash" = "${pkgs.git}/bin/git stash";
|
||||
|
||||
"edit" = "jj edit";
|
||||
"old" = "jj edit @-";
|
||||
"new" = "jj edit @+";
|
||||
"rebase" = "jj rebase";
|
||||
"pull" = "jj git fetch; jj catchup";
|
||||
"msg" = "jj describe -m";
|
||||
"branch" = "jj bookmark set";
|
||||
"stat" = "jj status";
|
||||
"push" = "jj git push";
|
||||
|
||||
"tidy" = "x test tidy --bless";
|
||||
"ui" = "x test tests/ui/";
|
||||
|
||||
"f" = "nautilus --no-desktop . &";
|
||||
};
|
||||
|
|
@ -165,15 +177,15 @@ in
|
|||
|
||||
${config.programs.jujutsu.package}/bin/jj util completion fish | source
|
||||
|
||||
if set -q tide_left_prompt_items; and not contains "jj" $tide_left_prompt_items
|
||||
set -l tide_item_jj_idx (contains -i "pwd" $tide_left_prompt_items)
|
||||
if test $tide_item_jj_idx
|
||||
set tide_left_prompt_items \
|
||||
$tide_left_prompt_items[1..$tide_item_jj_idx] \
|
||||
jj \
|
||||
$tide_left_prompt_items[(math $tide_item_jj_idx + 1)..-1]
|
||||
end
|
||||
end
|
||||
# if set -q tide_left_prompt_items; and not contains "jj" $tide_left_prompt_items
|
||||
# set -l tide_item_jj_idx (contains -i "pwd" $tide_left_prompt_items)
|
||||
# if test $tide_item_jj_idx
|
||||
# set tide_left_prompt_items \
|
||||
# $tide_left_prompt_items[1..$tide_item_jj_idx] \
|
||||
# jj \
|
||||
# $tide_left_prompt_items[(math $tide_item_jj_idx + 1)..-1]
|
||||
# end
|
||||
# end
|
||||
|
||||
function t
|
||||
cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
programs.jujutsu = {
|
||||
enable = true;
|
||||
package = pkgs.custom.jujutsu;
|
||||
# package = pkgs.custom.jujutsu;
|
||||
|
||||
settings = {
|
||||
user = {
|
||||
|
|
@ -11,9 +11,10 @@
|
|||
};
|
||||
|
||||
ui = {
|
||||
paginate = "never";
|
||||
pager = "${pkgs.delta}/bin/delta";
|
||||
# for delta
|
||||
diff.format = "git";
|
||||
diff-formatter = ":git";
|
||||
|
||||
default-command = [
|
||||
"log"
|
||||
|
|
@ -32,10 +33,86 @@
|
|||
# diff-editor = "${pkgs.meld}/bin/meld";
|
||||
};
|
||||
|
||||
revsets.log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()";
|
||||
# core.fsmonitor = "${pkgs.watchman}/bin/watchman";
|
||||
core.fsmonitor = "watchman";
|
||||
core.watchman.register-snapshot-trigger = true;
|
||||
|
||||
revsets.log = "@ | ancestors(tronk()..(visible_heads() & mine()), 2) | tronk()";
|
||||
# revsets.log = "trunk()..@ | @..trunk() | trunk() | @:: | fork_point(trunk() | @)";
|
||||
# revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)";
|
||||
|
||||
revset-aliases = {
|
||||
"tronk()" = ''latest((present(main) | present(master)) & remote_bookmarks())'';
|
||||
"my()" = "user(\"${config.programs.jujutsu.settings.user.email}\")";
|
||||
"user(x)" = "author(x) | committer(x)";
|
||||
current = ''bookmarks() & my() & ~immutable()'';
|
||||
"closest_bookmark(to)" = "heads(::to & bookmarks())";
|
||||
};
|
||||
|
||||
template-aliases = {
|
||||
"format_timestamp(timestamp)" = "timestamp.ago()";
|
||||
};
|
||||
|
||||
aliases = {
|
||||
tug = [
|
||||
"bookmark"
|
||||
"move"
|
||||
"--from"
|
||||
"closest_bookmark(@-)"
|
||||
"--to"
|
||||
"@-"
|
||||
];
|
||||
catchup = [
|
||||
"rebase"
|
||||
"-b"
|
||||
"all:current"
|
||||
"-d"
|
||||
"tronk()"
|
||||
"--skip-emptied"
|
||||
];
|
||||
};
|
||||
|
||||
templates = {
|
||||
log_node = ''
|
||||
label("node",
|
||||
coalesce(
|
||||
if(!self, label("elided", "~")),
|
||||
if(current_working_copy, label("working_copy", "@")),
|
||||
if(conflict, label("conflict", "×")),
|
||||
if(immutable, label("immutable", "*")),
|
||||
label("normal", "·")
|
||||
)
|
||||
)
|
||||
'';
|
||||
log = ''
|
||||
if(root,
|
||||
format_root_commit(self),
|
||||
label(if(current_working_copy, "working_copy"),
|
||||
concat(
|
||||
separate(" ",
|
||||
format_short_change_id_with_hidden_and_divergent_info(self),
|
||||
if(empty, label("empty", "(empty)")),
|
||||
if(description,
|
||||
description.first_line(),
|
||||
label(if(empty, "empty"), description_placeholder),
|
||||
),
|
||||
bookmarks,
|
||||
tags,
|
||||
working_copies,
|
||||
if(git_head, label("git_head", "HEAD")),
|
||||
if(conflict, label("conflict", "conflict")),
|
||||
if(config("ui.show-cryptographic-signatures").as_boolean(),
|
||||
format_short_cryptographic_signature(signature)),
|
||||
) ++ "\n",
|
||||
),
|
||||
)
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
signing = {
|
||||
sign-all = true;
|
||||
# sign-all = true;
|
||||
behavior = "own";
|
||||
backend = "ssh";
|
||||
key = "~/.ssh/id_ed25519.pub";
|
||||
};
|
||||
|
|
@ -43,6 +120,14 @@
|
|||
git = {
|
||||
push-bookmark-prefix = "jdonszelmann/";
|
||||
private-commits = "description(glob:'wip:*')";
|
||||
write-change-id-header = true;
|
||||
|
||||
fetch = [
|
||||
"upstream"
|
||||
"origin"
|
||||
];
|
||||
push = "origin";
|
||||
auto-local-bookmark = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
|
||||
tab q w e r t y u i o p [ ] \
|
||||
@cap a s d f g h j k l ; ' ret
|
||||
@lst z x c v b n m , . / rsft
|
||||
lsft z x c v b n m , . / rsft
|
||||
lctl lmet lalt spc ralt rctl
|
||||
)
|
||||
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
|
||||
tab q w e @replay t y u i o p @wup @wdown \
|
||||
@cap a s d f g left down up right ; ' bspc
|
||||
@lst z x C-c v bspc n @macro , . C-f rsft
|
||||
lsft z x C-c v bspc n @macro , . C-f rsft
|
||||
lctl lmet lalt spc ralt rctl
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,6 @@
|
|||
vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||
|
||||
|
||||
local otter = require'otter'
|
||||
otter.setup{}
|
||||
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"*.md"},
|
||||
callback = function() otter.activate({'python', 'rust', 'c', 'lua', 'bash' }, true, true, nil) end,
|
||||
})
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
mdx = "markdown",
|
||||
|
|
@ -14,57 +8,6 @@ vim.filetype.add({
|
|||
})
|
||||
|
||||
|
||||
local cmp = require("cmp")
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
view = {
|
||||
docs = {
|
||||
auto_open = false
|
||||
}
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
-- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
|
||||
['<C-g>'] = function()
|
||||
if cmp.visible_docs() then
|
||||
cmp.close_docs()
|
||||
else
|
||||
cmp.open_docs()
|
||||
end
|
||||
end
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = "otter" },
|
||||
{ name = 'path' },
|
||||
{ name = 'vsnip' },
|
||||
{ name = 'spell' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
}),
|
||||
comparators = {
|
||||
-- compare.score_offset, -- not good at all
|
||||
cmp.config.compare.locality,
|
||||
cmp.config.compare.recently_used,
|
||||
cmp.config.compare.score,
|
||||
cmp.config.compare.offset,
|
||||
cmp.config.compare.order,
|
||||
},
|
||||
}
|
||||
|
||||
-- key mapping
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
|
@ -194,47 +137,19 @@ vim.api.nvim_create_user_command('CloseBuffer', function (opts)
|
|||
end
|
||||
end, { desc = "Close Current Buffer", bang = true, })
|
||||
|
||||
vim.keymap.set("ca", "W", "w")
|
||||
vim.keymap.set("ca", "X", "x")
|
||||
vim.keymap.set("ca", "Q", "q")
|
||||
local function close_floating()
|
||||
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||
local config = vim.api.nvim_win_get_config(win)
|
||||
if config.relative ~= "" then
|
||||
vim.api.nvim_win_close(win, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
vim.keymap.set("ca", "q", "CloseBuffer")
|
||||
vim.keymap.set("ca", "qw", "quit")
|
||||
|
||||
-- format on wq and x and replace X, W and Q with x, w and q
|
||||
-- vim.cmd [[cnoreabbrev w execute "Format sync" <bar> w]]
|
||||
-- vim.cmd [[cnoreabbrev x execute "Format sync" <bar> w <bar> CustomCloseBuffer <cr>]]
|
||||
-- vim.cmd [[cabbrev W w]]
|
||||
-- vim.cmd [[cabbrev X execute "Format sync" <bar> x]]
|
||||
-- vim.cmd [[cabbrev Q CustomCloseBuffer]]
|
||||
-- vim.cmd [[cnoreabbrev q CustomCloseBuffer <cr>]]
|
||||
-- vim.cmd [[cnoreabbrev qa q]]
|
||||
-- vim.cmd [[nnoremap ; :]]
|
||||
vim.keymap.set("n", "<Esc>", close_floating, { desc = "Close floats, clear highlights" })
|
||||
|
||||
local builtin = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set('n', '<leader>s', "<cmd>vertical sb<cr>", {})
|
||||
vim.keymap.set('n', '<leader><leader>', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>f', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>h', builtin.pickers, {})
|
||||
-- vim.keymap.set('n', '<leader>h', builtin.search_history, {})
|
||||
vim.keymap.set('n', '<leader>b', function() builtin.buffers({sort_mru = true}) end, {})
|
||||
vim.keymap.set('n', '<leader>d', function() require('telescope.builtin').diagnostics({ severity_bound = 0, bufnr = 0 }) end, {})
|
||||
vim.keymap.set('n', '<leader>ad', function() require('telescope.builtin').diagnostics({ severity_bound = 0 }) end, {})
|
||||
vim.keymap.set('n', '<leader>em', "<cmd>RustLsp expandMacro<cr>")
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
|
||||
|
||||
|
||||
vim.keymap.set('n', '<leader>ct', "<cmd>CustomCloseBuffer<cr>")
|
||||
vim.keymap.set('n', '<leader>co', "<cmd>silent! BufferCloseAllButCurrent<cr>")
|
||||
vim.keymap.set('n', '<leader>cl', "<cmd>silent! BufferCloseBuffersLeft<cr>")
|
||||
vim.keymap.set('n', '<leader>cr', "<cmd>silent! BufferCloseBuffersRight<cr>")
|
||||
|
||||
-- like quit but for a single tab
|
||||
vim.keymap.set('n', '<leader>q', "<cmd>BufferClose<cr>", {})
|
||||
vim.keymap.set('n', '<leader>oq', "<cmd>BufOnly<cr>", {})
|
||||
|
||||
vim.keymap.set("n", "<leader>x", require("telescope.builtin").resume, {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
|
|
@ -298,3 +213,36 @@ vim.g.VM_reselect_first = 1
|
|||
vim.g.VM_notify_previously_selected = 1
|
||||
vim.g.VM_theme = "iceblue"
|
||||
|
||||
|
||||
|
||||
-- workaround for rust-analyzer server cancelled request
|
||||
for _, method in ipairs { 'textDocument/diagnostic', 'workspace/diagnostic' } do
|
||||
local default_diagnostic_handler = vim.lsp.handlers[method]
|
||||
vim.lsp.handlers[method] = function(err, result, context, config)
|
||||
if err ~= nil and err.code == -32802 then
|
||||
return
|
||||
end
|
||||
return default_diagnostic_handler(err, result, context, config)
|
||||
end
|
||||
end
|
||||
|
||||
require("hover").setup {
|
||||
init = function()
|
||||
require("hover.providers.lsp")
|
||||
require('hover.providers.gh')
|
||||
require('hover.providers.diagnostic')
|
||||
end,
|
||||
preview_opts = {
|
||||
border = 'rounded'
|
||||
},
|
||||
-- Whether the contents of a currently open hover window should be moved
|
||||
-- to a :h preview-window when pressing the hover keymap.
|
||||
preview_window = false,
|
||||
title = true,
|
||||
}
|
||||
|
||||
-- Setup keymaps
|
||||
vim.keymap.set("n", "K", require("hover").hover, {desc = "hover.nvim"})
|
||||
vim.keymap.set("n", "gK", require("hover").hover_select, {desc = "hover.nvim (select)"})
|
||||
-- vim.keymap.set("n", "<C-p>", function() require("hover").hover_switch("previous") end, {desc = "hover.nvim (previous source)"})
|
||||
-- vim.keymap.set("n", "<C-n>", function() require("hover").hover_switch("next") end, {desc = "hover.nvim (next source)"})
|
||||
|
|
|
|||
|
|
@ -1,9 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
map = mode: key: action: {
|
||||
inherit mode key action;
|
||||
};
|
||||
in
|
||||
{ pkgs, inputs, ... }:
|
||||
{
|
||||
home = {
|
||||
sessionVariables = {
|
||||
|
|
@ -14,6 +9,7 @@ in
|
|||
imports = [
|
||||
./options.nix
|
||||
./plugins.nix
|
||||
./keys.nix
|
||||
];
|
||||
|
||||
programs.nixvim = {
|
||||
|
|
@ -47,64 +43,8 @@ in
|
|||
extraLuaPackages = ps: [ ps.magick ];
|
||||
extraPackages = [ pkgs.imagemagick ];
|
||||
|
||||
# package = pkgs.neovim-unwrapped;
|
||||
package = (pkgs.neovim-unwrapped.override { lua = pkgs.luajit; }).overrideAttrs (_: {
|
||||
version = "git";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "neovim";
|
||||
repo = "neovim";
|
||||
rev = "76dcc7029b200e1d85024d7ba4a34c602e730dbe";
|
||||
hash = "sha256-y3LmGebXuQhLz9w1IzkDU8b464WvMvPCbIImpVvxmcI=";
|
||||
};
|
||||
buildInputs =
|
||||
[
|
||||
(pkgs.utf8proc.overrideAttrs (_: {
|
||||
version = "git";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "JuliaStrings";
|
||||
repo = "utf8proc";
|
||||
rev = "3de4596fbe28956855df2ecb3c11c0bbc3535838";
|
||||
hash = "sha256-DNnrKLwks3hP83K56Yjh9P3cVbivzssblKIx4M/RKqw=";
|
||||
};
|
||||
|
||||
}))
|
||||
]
|
||||
++ pkgs.neovim-unwrapped.buildInputs
|
||||
++ pkgs.neovim-unwrapped.nativeBuildInputs;
|
||||
});
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
key = "<f2>";
|
||||
action = "<cmd>Lspsaga rename<cr>";
|
||||
}
|
||||
{
|
||||
key = "<leader>o";
|
||||
action = "<cmd>Lspsaga outline<cr>";
|
||||
}
|
||||
{
|
||||
key = "<leader>.";
|
||||
action = "<cmd>Lspsaga code_action<cr>";
|
||||
}
|
||||
|
||||
# {
|
||||
# key = "/";
|
||||
# action = "<cmd>lua require('spectre').open_file_search({select_word=true})<CR>";
|
||||
# }
|
||||
|
||||
(map "n" "t" "<cmd>Neotree toggle<cr>")
|
||||
|
||||
# tab for indent/dedent
|
||||
(map "n" "<tab>" ">>_")
|
||||
(map "n" "<S-tab>" "<<_")
|
||||
(map "i" "<S-tab>" "<c-d>")
|
||||
(map "v" "<tab>" ">gv")
|
||||
(map "v" "<S-tab>" "<gv")
|
||||
|
||||
# to avoid many typos
|
||||
(map "n" ";" ":")
|
||||
];
|
||||
# package = (import inputs.unstable { inherit (pkgs) system; }).neovim-unwrapped;
|
||||
package = pkgs.neovim-unwrapped;
|
||||
|
||||
colorschemes.onedark = {
|
||||
enable = true;
|
||||
|
|
@ -117,6 +57,8 @@ in
|
|||
"@comment.documentation.rust".fg = "#77B767";
|
||||
"@comment.documentation".fg = "#77B767";
|
||||
"@comment".fg = "#426639";
|
||||
# "Visual".bg = "#2a2e36";
|
||||
# "Cursorline".bg = "#2a2e36";
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
|||
103
programs/nvim/keys.nix
Normal file
103
programs/nvim/keys.nix
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
_:
|
||||
let
|
||||
map = mode: key: action: {
|
||||
inherit mode key action;
|
||||
};
|
||||
luamap =
|
||||
mode: key: action:
|
||||
map mode key "<cmd>lua ${action}<cr>";
|
||||
telescope = "require('telescope.builtin')";
|
||||
in
|
||||
{
|
||||
programs.nixvim.keymaps = [
|
||||
(map "" "<f2>" "<cmd>Lspsaga rename<cr>")
|
||||
(map "" "<leader>o" "<cmd>Lspsaga outline<cr>")
|
||||
(map "" "<leader>." "<cmd>Lspsaga code_action<cr>")
|
||||
|
||||
# splitting
|
||||
(map "n" "<leader>s" "<cmd>vertical sb<cr>")
|
||||
|
||||
# closing
|
||||
(map "n" "<leader>w" "<cmd>BufferClose<cr>") # single buffer
|
||||
(map "n" "<leader>cb" "<cmd>BufferClose<cr>") # single buffer
|
||||
|
||||
(map "n" "<leader>ct" "<cmd>CloseBuffer<cr>") # buffer or extra tab
|
||||
(map "n" "<leader>q" "<cmd>CloseBuffer<cr>") # buffer or extra tab
|
||||
|
||||
(map "n" "<leader>co" "<cmd>silent! BufferCloseAllButVisible<cr>") # other buffers
|
||||
(map "n" "<leader>cl" "<cmd>silent! BufferCloseBuffersLeft<cr>") # other buffers (left)
|
||||
(map "n" "<leader>cr" "<cmd>silent! BufferCloseBuffersRight<cr>") # other buffers (right)
|
||||
|
||||
# moving
|
||||
(map "n" "mL" "<cmd>BufferMovePrevious<cr>") # left
|
||||
(map "n" "mr" "<cmd>BufferMoveNext<cr>") # right
|
||||
(map "n" "m0" "<cmd>BufferMoveStart<cr>") # start
|
||||
(map "n" "m$" "<cmd>BufferMoveEnd<cr>") # end
|
||||
|
||||
(map "n" "<leader>jb" "<cmd>BufferPick<cr>") # jump to tab
|
||||
|
||||
# jumplist
|
||||
# (map "n" "<leader><Tab>" "<C-o>")
|
||||
# (map "n" "<leader><S-Tab>" "<C-i>")
|
||||
(luamap "n" "<leader>r" "${telescope}.jumplist()")
|
||||
|
||||
# pickers
|
||||
(luamap "n" "<leader><leader>" "${telescope}.find_files()")
|
||||
(luamap "n" "<leader>f" "${telescope}.live_grep()")
|
||||
(luamap "n" "<leader>t" "${telescope}.lsp_document_symbols()")
|
||||
(luamap "n" "<leader>T" "${telescope}.lsp_dynamic_workspace_symbols()")
|
||||
# last used pickers/searches
|
||||
(luamap "n" "<leader>h" "${telescope}.pickers()")
|
||||
# open buffers
|
||||
(luamap "n" "<leader>b" "${telescope}.buffers({sort_mru = true})")
|
||||
|
||||
# diagnostics
|
||||
(map "n" "<leader>d" "<cmd>Trouble diagnostics toggle filter.buf=0<cr>")
|
||||
(map "n" "<leader>ad" "<cmd>Trouble diagnostics toggle<cr>")
|
||||
(luamap "n" "]d"
|
||||
"vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR, wrap=true })"
|
||||
)
|
||||
(luamap "n" "[d"
|
||||
"vim.diagnostic.goto_prev({ severity = vim.diagnostic.severity.ERROR, wrap=true })"
|
||||
)
|
||||
(luamap "n" "]w" "vim.diagnostic.goto_next({ wrap=true })")
|
||||
(luamap "n" "[w" "vim.diagnostic.goto_prev({ wrap=true })")
|
||||
|
||||
# docs with control-d just like in autocomplete
|
||||
(map "n" "<C-d>" "K")
|
||||
|
||||
# expand macro
|
||||
(map "n" "<leader>em" "<cmd>RustLsp expandMacro<cr>")
|
||||
|
||||
# easier quitting etc
|
||||
(map "ca" "W" "w")
|
||||
(map "ca" "X" "x")
|
||||
|
||||
(map "ca" "Q" "CloseBuffer")
|
||||
(map "ca" "q" "CloseBuffer")
|
||||
|
||||
# navigation
|
||||
(map "" "<leader><Left>" "<C-w><Left>")
|
||||
(map "" "<leader><Right>" "<C-w><Right>")
|
||||
(map "" "<leader><Up>" "<C-w><Up>")
|
||||
(map "" "<leader><Down>" "<C-w><Down>")
|
||||
(map "" "<leader><Down>" "<C-w><Down>")
|
||||
|
||||
# {
|
||||
# key = "/";
|
||||
# action = "<cmd>lua require('spectre').open_file_search({select_word=true})<CR>";
|
||||
# }
|
||||
|
||||
(map "n" "t" "<cmd>Neotree toggle<cr>")
|
||||
|
||||
# tab for indent/dedent
|
||||
(map "n" "<tab>" ">>_")
|
||||
(map "n" "<S-tab>" "<<_")
|
||||
(map "i" "<S-tab>" "<c-d>")
|
||||
(map "v" "<tab>" ">gv")
|
||||
(map "v" "<S-tab>" "<gv")
|
||||
|
||||
# to avoid many typos
|
||||
(map "n" ";" ":")
|
||||
];
|
||||
}
|
||||
|
|
@ -1,6 +1,28 @@
|
|||
_: {
|
||||
programs.nixvim.diagnostics = {
|
||||
# virtual_lines.enable = false;
|
||||
# # virtual_lines = {
|
||||
# # current_line = true;
|
||||
# # format = ''
|
||||
# # function(d)
|
||||
# # if d.severity == vim.diagnostic.severity.ERROR then
|
||||
# # return d
|
||||
# # else
|
||||
# # return ""
|
||||
# # end
|
||||
# # end
|
||||
# # '';
|
||||
# # };
|
||||
# virtual_text = false;
|
||||
update_in_insert = false; # annoying with virtual_lines which keep updating
|
||||
severity_sort = true;
|
||||
float = {
|
||||
border = "rounded";
|
||||
};
|
||||
};
|
||||
|
||||
programs.nixvim.opts = {
|
||||
lazyredraw = true;
|
||||
# lazyredraw = true;
|
||||
startofline = true;
|
||||
showmatch = true;
|
||||
|
||||
|
|
@ -26,6 +48,10 @@ _: {
|
|||
];
|
||||
|
||||
list = true;
|
||||
|
||||
swapfile = false;
|
||||
backup = false;
|
||||
autoread = true;
|
||||
undofile = true;
|
||||
undodir = "/home/jana/.vimdid";
|
||||
|
||||
|
|
@ -36,7 +62,7 @@ _: {
|
|||
|
||||
# relative line numbers except the current line
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
# relativenumber = true;
|
||||
|
||||
# show (usually) hidden characters
|
||||
listchars = {
|
||||
|
|
@ -52,5 +78,11 @@ _: {
|
|||
|
||||
# clipboard == system clipboard
|
||||
clipboard = "unnamedplus";
|
||||
|
||||
completeopt = [
|
||||
"menuone"
|
||||
"noselect"
|
||||
"noinsert"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,26 +9,16 @@ let
|
|||
hash = "sha256-mddnBvIrekHh60Ix6qIYAnv10Mu40LamGI47EXk9wSo=";
|
||||
};
|
||||
};
|
||||
# for lsp/cmp inside markdown code blocks
|
||||
otter = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "otter";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "jmbuhr";
|
||||
repo = "otter.nvim";
|
||||
rev = "cbb1be0586eae18cbea38ada46af428d2bebf81a";
|
||||
hash = "sha256-eya/8rG3O8UFeeBRDa5U8v3qay+q3iFwPnYtdX7ptCA=";
|
||||
};
|
||||
};
|
||||
fzy-lua-native = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "fzy-lua-native";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "romgrk";
|
||||
repo = "fzy-lua-native";
|
||||
rev = "9d720745d5c2fb563c0d86c17d77612a3519c506";
|
||||
hash = "sha256-pBV5iGa1+5gtM9BcDk8I5SKoQ9sydOJHsmyoBcxAct0=";
|
||||
};
|
||||
};
|
||||
in
|
||||
# fzy-lua-native = pkgs.vimUtils.buildVimPlugin {
|
||||
# name = "fzy-lua-native";
|
||||
# src = pkgs.fetchFromGitHub {
|
||||
# owner = "romgrk";
|
||||
# repo = "fzy-lua-native";
|
||||
# rev = "9d720745d5c2fb563c0d86c17d77612a3519c506";
|
||||
# hash = "sha256-pBV5iGa1+5gtM9BcDk8I5SKoQ9sydOJHsmyoBcxAct0=";
|
||||
# };
|
||||
# };
|
||||
{
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
|
|
@ -130,6 +120,16 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
treesitter-context = {
|
||||
enable = true;
|
||||
settings = {
|
||||
multiwindow = true;
|
||||
separator = "―";
|
||||
max_lines = 4;
|
||||
trim_scopes = "outer";
|
||||
};
|
||||
};
|
||||
|
||||
treesitter = {
|
||||
enable = true;
|
||||
|
||||
|
|
@ -142,6 +142,7 @@ in
|
|||
ensure_installed = "all";
|
||||
ignore_install = [
|
||||
"wing"
|
||||
"brightscript"
|
||||
];
|
||||
|
||||
highlight.enable = true;
|
||||
|
|
@ -149,32 +150,114 @@ in
|
|||
incremental_selection = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
# init_selection = "<CR>";
|
||||
scope_incremental = "ss";
|
||||
node_incremental = "si";
|
||||
node_decremental = "sd";
|
||||
scope_incremental = "s";
|
||||
node_incremental = "+";
|
||||
node_decremental = "-";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
rainbow-delimiters.enable = true;
|
||||
vim-surround.enable = true;
|
||||
cmp-nvim-lsp.enable = true;
|
||||
lsp-format.enable = true;
|
||||
fugitive.enable = false;
|
||||
fugitive.enable = true;
|
||||
lspkind.enable = true;
|
||||
crates.enable = true;
|
||||
fidget.enable = true;
|
||||
cmp.enable = true;
|
||||
nvim-autopairs.enable = true;
|
||||
# nvim-highlight-colors.enable = true;
|
||||
|
||||
cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
|
||||
settings = {
|
||||
completion.completeopt = "noselect";
|
||||
preselect = "None";
|
||||
|
||||
sources =
|
||||
let
|
||||
s = name: { inherit name; };
|
||||
in
|
||||
[
|
||||
{
|
||||
name = "nvim_lsp";
|
||||
priority = 8;
|
||||
}
|
||||
# (s "nvim_lsp_signature_help")
|
||||
# (s "treesitter")
|
||||
(s "path")
|
||||
(s "luasnip")
|
||||
# (s "crates")
|
||||
# (s "git")
|
||||
# (s "calc")
|
||||
# (s "buffer")
|
||||
];
|
||||
mapping =
|
||||
let
|
||||
next = ''
|
||||
function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end
|
||||
'';
|
||||
prev = ''
|
||||
function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end
|
||||
'';
|
||||
in
|
||||
{
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
"<C-d>" = ''
|
||||
function()
|
||||
if cmp.visible_docs() then
|
||||
cmp.close_docs()
|
||||
else
|
||||
cmp.open_docs()
|
||||
end
|
||||
end
|
||||
'';
|
||||
"<Tab>" = next;
|
||||
"<S-Tab>" = prev;
|
||||
"<Down>" = next;
|
||||
"<Up>" = prev;
|
||||
};
|
||||
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
|
||||
sorting.comparators = [
|
||||
"offset"
|
||||
"exact"
|
||||
"score"
|
||||
"recently_used"
|
||||
"locality"
|
||||
"kind"
|
||||
"length"
|
||||
"order"
|
||||
];
|
||||
window =
|
||||
let
|
||||
common_border = {
|
||||
border = "rounded";
|
||||
winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None";
|
||||
};
|
||||
in
|
||||
{
|
||||
completion = common_border;
|
||||
documentation = common_border;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
image = {
|
||||
enable = true;
|
||||
integrations.markdown = {
|
||||
enabled = true;
|
||||
clearInInsertMode = true;
|
||||
downloadRemoteImages = true;
|
||||
};
|
||||
};
|
||||
|
||||
# dial.nvim
|
||||
|
|
@ -294,6 +377,7 @@ in
|
|||
codeAction.keys = {
|
||||
quit = "<Esc>";
|
||||
};
|
||||
symbolInWinbar.enable = false;
|
||||
};
|
||||
|
||||
typst-vim = {
|
||||
|
|
@ -312,9 +396,9 @@ in
|
|||
|
||||
rustaceanvim = {
|
||||
enable = true;
|
||||
rustAnalyzerPackage = pkgs.rust-analyzer;
|
||||
|
||||
settings = {
|
||||
rustAnalyzerPackage = null;
|
||||
auto_attach = true;
|
||||
server = {
|
||||
standalone = false;
|
||||
|
|
@ -331,7 +415,7 @@ in
|
|||
# check = {
|
||||
# command = "+nightly clippy";
|
||||
# };
|
||||
cachePriming.enable = false;
|
||||
cachePriming.enable = true;
|
||||
|
||||
diagnostic = {
|
||||
refreshSupport = true;
|
||||
|
|
@ -468,6 +552,10 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
# leap = {
|
||||
# enable = true;
|
||||
# };
|
||||
|
||||
wilder = {
|
||||
enable = true;
|
||||
modes = [
|
||||
|
|
@ -520,7 +608,7 @@ in
|
|||
(function()
|
||||
local highlighters = {
|
||||
wilder.pcre2_highlighter(),
|
||||
wilder.lua_fzy_highlighter(),
|
||||
-- wilder.lua_fzy_highlighter(),
|
||||
}
|
||||
|
||||
local popupmenu_renderer = wilder.popupmenu_renderer(
|
||||
|
|
@ -576,10 +664,21 @@ in
|
|||
telescope = {
|
||||
enable = true;
|
||||
|
||||
extensions.ui-select.enable = true;
|
||||
extensions.fzf-native.enable = true;
|
||||
extensions = {
|
||||
ui-select.enable = true;
|
||||
fzf-native.enable = true;
|
||||
frecency.enable = true;
|
||||
};
|
||||
|
||||
settings = {
|
||||
file_ignore_patterns = [
|
||||
"^.git/"
|
||||
"^.jj/"
|
||||
"^.vscode/"
|
||||
"^.idea/"
|
||||
"^build/"
|
||||
"^target/"
|
||||
];
|
||||
defaults = {
|
||||
path_display = [ "smart" ];
|
||||
layout_strategy = "horizontal";
|
||||
|
|
@ -591,6 +690,11 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
# diagnostics
|
||||
trouble = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# tabs
|
||||
barbar = {
|
||||
enable = true;
|
||||
|
|
@ -600,6 +704,11 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
# for lsp/cmp inside markdown code blocks
|
||||
otter = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
none-ls = {
|
||||
enable = true;
|
||||
sources = {
|
||||
|
|
@ -616,32 +725,27 @@ in
|
|||
web-devicons.enable = true;
|
||||
};
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
vim-vsnip
|
||||
cmp-vsnip
|
||||
cmp-path
|
||||
cmp-spell
|
||||
|
||||
telescope-ui-select-nvim
|
||||
telescope-fzf-native-nvim
|
||||
|
||||
vim-suda
|
||||
render-markdown
|
||||
otter
|
||||
vim-astro
|
||||
nvim-web-devicons
|
||||
vim-visual-multi
|
||||
vim-gh-line
|
||||
BufOnly-vim
|
||||
neoconf-nvim
|
||||
vim-autoswap
|
||||
targets-vim
|
||||
|
||||
fzy-lua-native
|
||||
# fzy-lua-native
|
||||
cpsm
|
||||
|
||||
# jj
|
||||
vim-jjdescription
|
||||
|
||||
hover-nvim
|
||||
|
||||
];
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,143 +1,166 @@
|
|||
{ pkgs, ... }: {
|
||||
programs.tmux =
|
||||
{
|
||||
enable = true;
|
||||
mouse = true;
|
||||
clock24 = true;
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
mouse = true;
|
||||
clock24 = true;
|
||||
|
||||
shortcut = "k";
|
||||
shortcut = "k";
|
||||
|
||||
|
||||
plugins = with pkgs; [
|
||||
{
|
||||
plugin = tmuxPlugins.mkTmuxPlugin {
|
||||
pluginName = "suspend";
|
||||
version = "1a2f806";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "MunifTanjim";
|
||||
repo = "tmux-suspend";
|
||||
rev = "1a2f806666e0bfed37535372279fa00d27d50d14";
|
||||
sha256 = "0j7vjrwc7gniwkv1076q3wc8ccwj42zph5wdmsm9ibz6029wlmzv";
|
||||
};
|
||||
plugins = with pkgs; [
|
||||
{
|
||||
plugin = tmuxPlugins.mkTmuxPlugin {
|
||||
pluginName = "suspend";
|
||||
version = "1a2f806";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "MunifTanjim";
|
||||
repo = "tmux-suspend";
|
||||
rev = "1a2f806666e0bfed37535372279fa00d27d50d14";
|
||||
sha256 = "0j7vjrwc7gniwkv1076q3wc8ccwj42zph5wdmsm9ibz6029wlmzv";
|
||||
};
|
||||
extraConfig = ''
|
||||
set -g @suspend_key 'F11'
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = tmuxPlugins.mode-indicator;
|
||||
}
|
||||
];
|
||||
};
|
||||
extraConfig = ''
|
||||
set -g @suspend_key 'F11'
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = tmuxPlugins.mode-indicator;
|
||||
}
|
||||
];
|
||||
|
||||
extraConfig = ''
|
||||
# unbind every single normal keybinding
|
||||
unbind-key -a
|
||||
extraConfig = ''
|
||||
# unbind every single normal keybinding
|
||||
unbind-key -a
|
||||
|
||||
# for special characters to work right
|
||||
# like <C-_>
|
||||
# set-window-option -g xterm-keys on
|
||||
set -g default-terminal "screen-256color"
|
||||
# for special characters to work right
|
||||
# like <C-_>
|
||||
# set-window-option -g xterm-keys on
|
||||
set -g default-terminal "screen-256color"
|
||||
|
||||
set -g set-titles on
|
||||
set -g allow-passthrough on
|
||||
set -s escape-time 0
|
||||
set -g set-titles on
|
||||
set -g allow-passthrough on
|
||||
set -s escape-time 0
|
||||
|
||||
set-option -g default-shell ${pkgs.fish}/bin/fish
|
||||
set -ga terminal-features "\*:hyperlinks"
|
||||
set-option -g default-shell ${pkgs.fish}/bin/fish
|
||||
set -ga terminal-features "\*:hyperlinks"
|
||||
|
||||
set-window-option -g mode-keys vi
|
||||
set-window-option -g mode-keys vi
|
||||
|
||||
# clipboard stuff
|
||||
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
|
||||
bind v copy-mode
|
||||
bind p paste-buffer -p
|
||||
set -s set-clipboard on
|
||||
# clipboard stuff
|
||||
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
|
||||
bind v copy-mode
|
||||
bind p paste-buffer -p
|
||||
set -s set-clipboard on
|
||||
|
||||
# get back normal terminal emulator bindings
|
||||
bind-key -n S-PPage copy-mode -u
|
||||
bind-key -T copy-mode -n S-NPage send-keys -X page-down
|
||||
# get back normal terminal emulator bindings
|
||||
bind-key -n S-PPage copy-mode -u
|
||||
bind-key -T copy-mode -n S-NPage send-keys -X page-down
|
||||
|
||||
# don't scroll to end when copying with mouse
|
||||
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe
|
||||
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe
|
||||
bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
bind-key -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
bind-key -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
# don't scroll to end when copying with mouse
|
||||
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe
|
||||
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe
|
||||
bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
bind-key -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
bind-key -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||
|
||||
# window control
|
||||
bind t new-window -c "#{pane_current_path}"
|
||||
bind-key Tab next-window
|
||||
bind-key BTab previous-window
|
||||
set -g automatic-rename-format "#{?#{==:#{pane_current_path},$HOME},~,#{b:pane_current_path}} (#{pane_current_command})"
|
||||
set -g renumber-windows on
|
||||
bind-key Q confirm-before -p "kill-window #W? (y/n)" kill-window
|
||||
bind A last-window
|
||||
# window control
|
||||
bind t new-window -c "#{pane_current_path}"
|
||||
bind-key Tab next-window
|
||||
bind-key BTab previous-window
|
||||
set -g automatic-rename-format "#{?#{==:#{pane_current_path},$HOME},~,#{b:pane_current_path}} (#{pane_current_command})"
|
||||
set -g renumber-windows on
|
||||
bind-key Q confirm-before -p "kill-window #W? (y/n)" kill-window
|
||||
bind A last-window
|
||||
|
||||
bind-key 1 select-window -t :0
|
||||
bind-key 2 select-window -t :1
|
||||
bind-key 3 select-window -t :2
|
||||
bind-key 4 select-window -t :3
|
||||
bind-key 5 select-window -t :4
|
||||
bind-key 6 select-window -t :5
|
||||
bind-key 7 select-window -t :6
|
||||
bind-key 8 select-window -t :7
|
||||
bind-key 9 select-window -t :8
|
||||
bind-key 0 select-window -t :9
|
||||
bind-key 1 select-window -t :0
|
||||
bind-key 2 select-window -t :1
|
||||
bind-key 3 select-window -t :2
|
||||
bind-key 4 select-window -t :3
|
||||
bind-key 5 select-window -t :4
|
||||
bind-key 6 select-window -t :5
|
||||
bind-key 7 select-window -t :6
|
||||
bind-key 8 select-window -t :7
|
||||
bind-key 9 select-window -t :8
|
||||
bind-key 0 select-window -t :9
|
||||
|
||||
# pane control
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
bind L split-window -h -c "#{pane_current_path}"
|
||||
bind J split-window -v -c "#{pane_current_path}"
|
||||
bind H split-window -h -b -c "#{pane_current_path}"
|
||||
bind K split-window -v -b -c "#{pane_current_path}"
|
||||
bind x swap-pane -D
|
||||
bind -r a select-pane -l
|
||||
bind-key q confirm-before -p "kill-pane #P? (y/n)" kill-pane
|
||||
# pane control
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
bind L split-window -h -c "#{pane_current_path}"
|
||||
bind J split-window -v -c "#{pane_current_path}"
|
||||
bind H split-window -h -b -c "#{pane_current_path}"
|
||||
bind K split-window -v -b -c "#{pane_current_path}"
|
||||
bind x swap-pane -D
|
||||
|
||||
bind-key o choose-tree -wZ
|
||||
bind-key O choose-tree -sZ
|
||||
# double-click ^k (or lshift with kanata) for previous pane like ^w in vim
|
||||
bind -r ^k select-pane -l
|
||||
bind-key q confirm-before -p "kill-pane #P? (y/n)" kill-pane
|
||||
|
||||
# get back command mode and some other basics...
|
||||
bind : command-prompt
|
||||
bind r source-file ~/.config/tmux/tmux.conf \; display "config reloaded"
|
||||
bind-key ? list-keys
|
||||
bind-key o choose-tree -wZ
|
||||
bind-key O choose-tree -sZ
|
||||
|
||||
# Scroll oin man etc
|
||||
tmux_commands_with_legacy_scroll="nano less more man git"
|
||||
# get back command mode and some other basics...
|
||||
bind : command-prompt
|
||||
bind r source-file ~/.config/tmux/tmux.conf \; display "config reloaded"
|
||||
bind-key ? list-keys
|
||||
|
||||
bind-key -T root WheelUpPane \
|
||||
if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \
|
||||
'send -Mt=' \
|
||||
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
|
||||
"send -t= Up" "copy-mode -et="'
|
||||
# Scroll oin man etc
|
||||
tmux_commands_with_legacy_scroll="nano less more man git"
|
||||
|
||||
bind-key -T root WheelDownPane \
|
||||
if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
|
||||
'send -Mt=' \
|
||||
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
|
||||
"send -t= Down" "send -Mt="'
|
||||
bind-key -T root WheelUpPane \
|
||||
if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \
|
||||
'send -Mt=' \
|
||||
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
|
||||
"send -t= Up" "copy-mode -et="'
|
||||
|
||||
bind-key -T root DoubleClick1Pane run-shell "cd '#{pane_current_path}'; echo '#{mouse_line}' | ${pkgs.writeScriptBin "open-file" ''
|
||||
open_file () {
|
||||
input=`cat`
|
||||
link=$(echo "$input" | grep -Po '[^ \\]*/[^ \\]*\.[^ \\]*\:[0-9]+' | sed 's/\:/|/g')
|
||||
bind-key -T root WheelDownPane \
|
||||
if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
|
||||
'send -Mt=' \
|
||||
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
|
||||
"send -t= Down" "send -Mt="'
|
||||
|
||||
if [ ! -z "$link" ]; then
|
||||
echo "LINK = $link"
|
||||
vim_proc=$(pgrep vim | xargs pwdx | grep $(pwd -P) | awk '{print $1}' | sed 's/\:*$//g' | xargs -I{} find /run/user/1000 -depth -maxdepth 1 -name "nvim.{}.0")
|
||||
bind-key -T copy-mode-vi ] \
|
||||
send-keys -X clear-selection \; \
|
||||
send-keys -X search-forward "--> " \; \
|
||||
send-keys -X next-word \; \
|
||||
send-keys -X begin-selection \; \
|
||||
send-keys -X jump-forward ":" \; \
|
||||
send-keys -X jump-to-forward ":" \;
|
||||
|
||||
nvim --server "$vim_proc" --remote-send "<C-\><C-N>:e $link<cr>"
|
||||
fi
|
||||
}
|
||||
bind-key -T copy-mode-vi [ \
|
||||
send-keys -X clear-selection \; \
|
||||
send-keys -X start-of-line \; \
|
||||
send-keys -X search-backward "--> " \; \
|
||||
send-keys -X next-word \; \
|
||||
send-keys -X begin-selection \; \
|
||||
send-keys -X jump-forward ":" \; \
|
||||
send-keys -X jump-to-forward ":" \;
|
||||
|
||||
open_file 2>&1 >> ~/open-file.log
|
||||
bind-key [ copy-mode \; send-keys [
|
||||
bind-key ] copy-mode \; send-keys ]
|
||||
|
||||
''}/bin/open-file"
|
||||
'';
|
||||
};
|
||||
bind d select-pane -l \; send-keys [
|
||||
|
||||
'';
|
||||
};
|
||||
# bind-key -T root DoubleClick1Pane run-shell "cd '#{pane_current_path}'; echo '#{mouse_line}' | ${pkgs.writeScriptBin "open-file" ''
|
||||
# open_file () {
|
||||
# input=`cat`
|
||||
# link=$(echo "$input" | grep -Po '[^ \\]*/[^ \\]*\.[^ \\]*\:[0-9]+' | sed 's/\:/|/g')
|
||||
#
|
||||
# if [ ! -z "$link" ]; then
|
||||
# echo "LINK = $link"
|
||||
# vim_proc=$(pgrep vim | xargs pwdx | grep $(pwd -P) | awk '{print $1}' | sed 's/\:*$//g' | xargs -I{} find /run/user/1000 -depth -maxdepth 1 -name "nvim.{}.0")
|
||||
#
|
||||
# nvim --server "$vim_proc" --remote-send "<C-\><C-N>:e $link<cr>"
|
||||
# fi
|
||||
# }
|
||||
#
|
||||
# open_file 2>&1 >> ~/open-file.log
|
||||
#
|
||||
# ''}/bin/open-file"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue