Compare commits
11 commits
8aec761a20
...
506b6cb2f6
Author | SHA1 | Date | |
---|---|---|---|
506b6cb2f6 | |||
d10db1be7d | |||
97114d74fb | |||
a5727c135b | |||
e2f77e6faa | |||
546195ad56 | |||
8e3ef257d3 | |||
c977bfea06 | |||
a5fee8959f | |||
df10d40510 | |||
49f6a0ef58 |
26 changed files with 1339 additions and 293 deletions
|
@ -16,6 +16,7 @@ asix-ax88179-dkms A kernel module for ASIX AX88178A AX88179 USB 3.0 network adap
|
|||
aspell-de German dictionary for aspell R
|
||||
aspell-en English dictionary for aspell R
|
||||
atool A script for managing file archives of various types R
|
||||
atuin Magical shell history R
|
||||
aubio A tool for extracting annotations from audio signals R
|
||||
autofs A kernel-based automounter for Linux A
|
||||
barrier Open-source KVM software based on Synergy (GUI) R
|
||||
|
@ -179,6 +180,7 @@ needrestart Restart daemons after library updates. A
|
|||
neomutt A version of mutt with added features R
|
||||
neovim Fork of Vim aiming to improve user experience, plugins, and GUIs R
|
||||
net-tools Configuration tools for Linux networking R
|
||||
netbird-bin WireGuard-based mesh network A
|
||||
netctl Profile based systemd network management R
|
||||
nethogs A net top tool which displays traffic used per process instead of per IP or interface R
|
||||
network-manager-applet Applet for managing network connections R
|
||||
|
@ -253,7 +255,7 @@ qt6-svg Classes for displaying the contents of SVG files R
|
|||
qt6-wayland Provides APIs for Wayland R
|
||||
qtcurve-gtk2 A configurable set of widget styles for KDE and Gtk R
|
||||
quarto-cli-bin An open-source scientific and technical publishing system built on Pandoc (binary from official repo) A
|
||||
qutebrowser A keyboard-driven, vim-like browser based on PyQt5 R
|
||||
qutebrowser A keyboard-driven, vim-like browser based on Python and Qt R
|
||||
refind An EFI boot manager R
|
||||
refind-btrfs Generate rEFInd manual boot stanzas from Btrfs snapshots A
|
||||
reflector A Python 3 module and script to retrieve and filter the latest Pacman mirror list. R
|
||||
|
@ -277,6 +279,7 @@ smartmontools Control and monitor S.M.A.R.T. enabled ATA and SCSI Hard Drives R
|
|||
snap-pac Pacman hooks that use snapper to create pre/post btrfs snapshots like openSUSE's YaST R
|
||||
speedtest-cli Command line interface for testing internet bandwidth using speedtest.net R
|
||||
sshfs FUSE client based on the SSH File Transfer Protocol R
|
||||
starship The cross-shell prompt for astronauts R
|
||||
steam Valve's digital software delivery system R
|
||||
sudo Give certain users the ability to run some commands as root R
|
||||
surfraw Shell Users' Revolutionary Front Rage Against the Web R
|
||||
|
@ -357,4 +360,3 @@ zoxide A smarter cd command for your terminal R
|
|||
zq Tooling for super-structured data A
|
||||
zsh-autosuggestions Fish-like autosuggestions for zsh R
|
||||
zsh-fast-syntax-highlighting Optimized and extended zsh-syntax-highlighting A
|
||||
zsh-pure-prompt Pretty, minimal and fast ZSH prompt A
|
||||
|
|
Can't render this file because it has a wrong number of fields in line 30.
|
|
@ -67,12 +67,7 @@ local function molten_mappings_set()
|
|||
map("n", "<localleader>cN", ":MoltenInit ")
|
||||
map("n", "<localleader>cD", ":MoltenDeinit<cr>")
|
||||
map("n", "<localleader>cR", ":MoltenRestart<cr>")
|
||||
map(
|
||||
"n",
|
||||
"<localleader>cA",
|
||||
require("quarto.runner").run_all,
|
||||
{ silent = true, desc = "Evaluate all code cells" }
|
||||
)
|
||||
map("n", "<localleader>cA", require("quarto.runner").run_all, { silent = true, desc = "Evaluate all code cells" })
|
||||
map(
|
||||
"n",
|
||||
"<localleader>ca",
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
"cmp-tmux": { "branch": "main", "commit": "97ec06b8030b8bf6d1fd83d49bdd16c98e04c845" },
|
||||
"cmp-treesitter": { "branch": "master", "commit": "13e4ef8f4dd5639fca2eb9150e68f47639a9b37d" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"codeium.nvim": { "branch": "main", "commit": "a0d43300f9a17a6ac775947ae4fb6b99ac5a92d0" },
|
||||
"completion-vcard": { "branch": "master", "commit": "2220fd517a985ececed1adcf0e5be8f2815564c7" },
|
||||
"conform.nvim": { "branch": "master", "commit": "ce95e6b2a072d81fd312ff213f241cacab1eccef" },
|
||||
"dial.nvim": { "branch": "master", "commit": "54b503f906bc9e5ab85288414840a1b86d40769f" },
|
||||
|
@ -34,40 +33,38 @@
|
|||
"git-conflict.nvim": { "branch": "main", "commit": "4e0191c9a0ae05d7fbdcdc7f15cd358f56d23bfb" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" },
|
||||
"headlines.nvim": { "branch": "master", "commit": "e3d7bfdf40e41a020d966d35f8b48d75b90367d2" },
|
||||
"image.nvim": { "branch": "master", "commit": "c40215d7d7d1d8c823ee9a77be1a894d5c8df41b" },
|
||||
"image.nvim": { "branch": "master", "commit": "9b6248bd8b58b505559e31eb581b7c4638369ec3" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
|
||||
"lightspeed.nvim": { "branch": "main", "commit": "fcc72d8a4d5f4ebba62d8a3a0660f88f1b5c3b05" },
|
||||
"lsp-setup.nvim": { "branch": "main", "commit": "7276e54faf4af909b6ea171975fd4179ebe65cec" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
|
||||
"lsp-setup.nvim": { "branch": "main", "commit": "22ba14fb5c4208fd93f616d7b99bb47656e6e144" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "9becceee5740b7db6914da87358a183ad11b2049" },
|
||||
"markmap.nvim": { "branch": "main", "commit": "3befc2a54c2448a16c30c1c7762aab263f22946a" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "4eb8e15e3c0757303d4c6dea64d2981fc679e990" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "8b70e7f1e0a4119c1234c3bde4a01c241cabcc74" },
|
||||
"mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" },
|
||||
"mdeval.nvim": { "branch": "master", "commit": "2654caf8ecaad702b50199d18e39cff23d81e0ba" },
|
||||
"mini.nvim": { "branch": "main", "commit": "b5645ac6eefce8e7af9d7dd4e5e296a81cba8a10" },
|
||||
"molten-nvim": { "branch": "main", "commit": "883ecb358e3b4dca9a83daa05b51f22b81f878e9" },
|
||||
"neotest": { "branch": "master", "commit": "009328955066ae6c170d24bb0de5f168d8760ff8" },
|
||||
"molten-nvim": { "branch": "main", "commit": "1752f9d0027bf8ccb3440416e1112cae8f8f412c" },
|
||||
"neotest": { "branch": "master", "commit": "6aa6e4529a4a125b49c48541b97ba146ceee2441" },
|
||||
"neotest-python": { "branch": "master", "commit": "81d2265efac717bb567bc15cc652ae10801286b3" },
|
||||
"nvim-FeMaco.lua": { "branch": "main", "commit": "6af458f0196215f397db31a6e1fb2df795811693" },
|
||||
"nvim-base16": { "branch": "master", "commit": "010bedf0b7c01ab4d4e4e896a8527d97c222351d" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "41d7633e4146dce1072de32cea31ee31b056a131" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
|
||||
"nvim-base16": { "branch": "master", "commit": "96e308958625a84940d5e443475465abf99c7bd9" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
|
||||
"nvim-coverage": { "branch": "main", "commit": "cf4b5c61dfac977026a51a2bcad9173c272986ce" },
|
||||
"nvim-lint": { "branch": "master", "commit": "849ccb610de3f6ce1a239ea1e68568ef1a53d5df" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "f451052bd6804e9e5ccd0ac874d7df8d3d4c55b9" },
|
||||
"nvim-lint": { "branch": "master", "commit": "32f98300881f38f4e022391f240188fec42f74db" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "9099871a7c7e1c16122e00d70208a2cd02078d80" },
|
||||
"nvim-surround": { "branch": "main", "commit": "703ec63aa798e5e07d309b35e42def34bebe0174" },
|
||||
"nvim-toggleterm.lua": { "branch": "main", "commit": "cbd041d91b90cd3c02df03fe6133208888f8e008" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "141c0f97c35f274031294267808ada59bb5fb08e" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "50f30bcd8c62ac4a83d133d738f268279f2c2ce2" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "63260da18bf273c76b8e2ea0db84eb901cab49ce" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "cfa8ee19ac9bae9b7fb2958eabe2b45b70c56ccb" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "652ec514d6ba8bc4a3c2de76c855fe668e2c7196" },
|
||||
"nvim-treesitter-endwise": { "branch": "master", "commit": "4c344ffc8d54d7e1ba2cefaaa2c10ea93aa1cc2d" },
|
||||
"nvim-treesitter-textsubjects": { "branch": "master", "commit": "011c09784f1a95cf469a48c1993b664190440391" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "8515e48a277a2f4947d91004d9aa92c29fdc5e18" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" },
|
||||
"nvim-ts-rainbow2": { "branch": "master", "commit": "b3120cd5ae9ca524af9cb602f41e12e301fa985f" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "8b2e5ef9eb8a717221bd96cb8422686d65a09ed5" },
|
||||
"otter.nvim": { "branch": "main", "commit": "9a3db06bf3abadafb93279648317984ca789b888" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "43aa2ddf476012a2155f5f969ee55ab17174da7a" },
|
||||
"otter.nvim": { "branch": "main", "commit": "e4cfb3444e65750023d9db1947d1d12463d06eb5" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
|
||||
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
|
||||
"quarto-nvim": { "branch": "main", "commit": "0a35b3890e9d723b730506d7d8b3ba3d0d6aae2e" },
|
||||
|
|
|
@ -3,7 +3,6 @@ for _, source in ipairs({
|
|||
"core.lazy",
|
||||
"core.autocmds",
|
||||
"core.mappings",
|
||||
"core.look",
|
||||
}) do
|
||||
local status_ok, fault = pcall(require, source)
|
||||
if not status_ok then
|
||||
|
|
|
@ -34,5 +34,9 @@ vim.opt.rtp:prepend(lazypath)
|
|||
require("lazy").setup({
|
||||
spec = { { import = "plugins" } },
|
||||
defaults = { lazy = true, version = "*" },
|
||||
performance = { rtp = { disabled_plugins = { "netrw", "netrwPlugin" } } },
|
||||
performance = {
|
||||
rtp = { disabled_plugins = { "netrw", "netrwPlugin" } },
|
||||
cache = { enable = false },
|
||||
},
|
||||
})
|
||||
vim.keymap.set("n", "<leader>vl", ":Lazy<cr>", { desc = "Lazy" })
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
local colorsfile = vim.fn.stdpath("state") .. "/colorscheme.lua"
|
||||
local function source_colors()
|
||||
if vim.fn.filereadable(colorsfile) == 1 then
|
||||
vim.cmd("source " .. colorsfile)
|
||||
end
|
||||
end
|
||||
|
||||
-- set on startup
|
||||
source_colors()
|
||||
|
||||
-- continuously watch colors file for changes
|
||||
local fwatch = require("fwatch")
|
||||
fwatch.watch(colorsfile, {
|
||||
on_event = vim.schedule_wrap(function()
|
||||
source_colors()
|
||||
end),
|
||||
})
|
|
@ -1,7 +1,14 @@
|
|||
local map = vim.keymap.set
|
||||
local prefix = require("which-key").register
|
||||
local is_available = require("util").is_available
|
||||
|
||||
if is_available("which-key") then
|
||||
local prefix = require("which-key").register
|
||||
prefix({ ["<leader>v"] = { name = "+vim" } })
|
||||
prefix({ ["<leader>s"] = { name = "+show" } })
|
||||
prefix({ ["<localleader>s"] = { name = "+set" } })
|
||||
prefix({ ["<localleader>Z"] = { name = "+spelling" } })
|
||||
end
|
||||
|
||||
-- The general ideas behind these mappings:
|
||||
--
|
||||
-- * Leader prefix is the generally preferred way to map new things, however
|
||||
|
@ -112,66 +119,6 @@ map("n", "<leader>T", ":tabedit | Vifm<cr>", { desc = "open tab" })
|
|||
-- select the whole buffer with <leader>-a
|
||||
map("n", "<leader>a", "ggVG", { desc = "select all" })
|
||||
|
||||
-- PLUGIN: Navigator.nvim
|
||||
map("n", "<c-w>h", '<CMD>lua require("Navigator").left()<cr>', { silent = true })
|
||||
map("n", "<c-w>k", '<CMD>lua require("Navigator").up()<cr>', { silent = true })
|
||||
map("n", "<c-w>l", '<CMD>lua require("Navigator").right()<cr>', { silent = true })
|
||||
map("n", "<c-w>j", '<CMD>lua require("Navigator").down()<cr>', { silent = true })
|
||||
map("n", "<c-w>p", '<CMD>lua require("Navigator").previous()<cr>', { silent = true })
|
||||
|
||||
-- PLUGIN: Vifm.vim
|
||||
-- open/close file tree with leader-e
|
||||
map("n", "<leader>e", ":Vifm<cr>", { desc = "browse files" })
|
||||
-- open current file tree with current file directory
|
||||
map("n", "<leader>E", ":Vifm getcwd()<cr>", { desc = "browse project" })
|
||||
|
||||
-- set 'v'im-related options
|
||||
prefix({ ["<leader>v"] = { name = "+vim" } })
|
||||
map("n", "<leader>vc", ":Vifm " .. vim.fn.stdpath("config") .. "/lua<cr>", { desc = "open config" })
|
||||
map("n", "<leader>vh", ":lua require 'telescope.builtin'.help_tags()<cr>", { desc = "help tags" })
|
||||
map("n", "<leader>vH", ":lua require 'telescope.builtin'.man_pages()<cr>", { desc = "man pages" })
|
||||
map(
|
||||
"n",
|
||||
"<leader>vC",
|
||||
":lua require 'telescope.builtin'.colorscheme(require 'telescope.themes'.get_ivy())<cr>",
|
||||
{ desc = "colorschemes" }
|
||||
)
|
||||
map("n", "<leader>vl", ":Lazy<cr>", { desc = "Lazy" })
|
||||
|
||||
-- PLUGIN: Telescope GLOBAL FUZZY FINDING
|
||||
-- buffers and files in current workdir
|
||||
prefix({ ["<leader>f"] = { name = "+find" } })
|
||||
map(
|
||||
"n",
|
||||
"<leader>fb",
|
||||
":lua require 'telescope.builtin'.buffers(require 'telescope.themes'.get_ivy())<cr>",
|
||||
{ desc = "list buffers" }
|
||||
)
|
||||
-- most recently used / MRU, bound to S since it is essentially a larger
|
||||
-- go-back intention than just buffers
|
||||
map(
|
||||
"n",
|
||||
"<leader>fo",
|
||||
":lua require 'telescope.builtin'.oldfiles(require 'telescope.themes'.get_ivy())<cr>",
|
||||
{ desc = "list old files" }
|
||||
)
|
||||
-- fuzzy find files in cwd
|
||||
map("n", "<leader>ff", ":lua require 'telescope.builtin'.find_files()<cr>", { desc = "find files" })
|
||||
-- fuzzy find hidden files in cwd
|
||||
map("n", "<leader>fh", ":lua require 'telescope.builtin'.find_files({hidden=true})<cr>", { desc = "find hidden files" })
|
||||
-- general full-text search in cwd with rg
|
||||
map("n", "<leader>fw", ":lua require 'telescope.builtin'.live_grep()<cr>", { desc = "grep search" })
|
||||
|
||||
-- git status
|
||||
map("n", "<leader>fg", ":lua require 'telescope.builtin'.git_status()<cr>", { desc = "git status" })
|
||||
-- git buffercommits
|
||||
map("n", "<leader>fc", ":lua require 'telescope.builtin'.git_bcommits()<cr>", { desc = "git buffer commits" })
|
||||
-- git commitlog
|
||||
map("n", "<leader>fl", ":lua require 'telescope.builtin'.git_commits()<cr>", { desc = "git commit log" })
|
||||
|
||||
-- spell suggestions
|
||||
map("n", "z=", ":lua require 'telescope.builtin'.spell_suggest(require 'telescope.themes'.get_ivy())<cr>")
|
||||
|
||||
-- Format current Paragraph (esp useful in prose writing)
|
||||
map("n", "<localleader>q", "gqap", { silent = true, desc = "Format current paragraph" })
|
||||
map("x", "<localleader>q", "gq", { silent = true, desc = "Format {motion}" })
|
||||
|
@ -180,7 +127,6 @@ map("n", "<localleader>Q", "vapJgqap", { silent = true, desc = "Unformat then fo
|
|||
-- SPELL CHECKING
|
||||
-- Move to the prev/next spelling error with [S ]S
|
||||
-- Move to the prev/next spelling error or suggestion with [s ]s
|
||||
prefix({ ["<localleader>Z"] = { name = "+Spelling" } })
|
||||
map("n", "<localleader>ZZ", ":setlocal spell! spelllang=en_us,en_gb,de_de<cr>", { desc = "Toggle spellcheck" })
|
||||
map("n", "<localleader>ZE", ":setlocal spell! spelllang=en_us<cr>", { desc = "Toggle EN_US spellcheck" })
|
||||
map("n", "<localleader>ZB", ":setlocal spell! spelllang=en_gb<cr>", { desc = "Toggle EN_GB spellcheck" })
|
||||
|
@ -188,81 +134,3 @@ map("n", "<localleader>ZD", ":setlocal spell! spelllang=de_de<cr>", { desc = "To
|
|||
-- undo last spelling mistake from insert and normal mode
|
||||
map("i", "<c-z>", "<C-G>u<Esc>[s1z=`]a<C-G>u")
|
||||
map("n", "<localleader>z", "ms[s1z=`s", { desc = "Fix last spell error" })
|
||||
|
||||
prefix({ ["<leader>s"] = { name = "+show" } })
|
||||
-- Set vim to distraction free prose mode
|
||||
map("n", "<leader>sz", ":ZenMode<cr>", { silent = true })
|
||||
-- PLUGIN: mini.nvim
|
||||
map("n", "<leader>sm", ":lua MiniMap.toggle()<cr>", { silent = true, desc = "minimap" })
|
||||
map("n", "<leader>ss", ":lua MiniStarter.open()<cr>", { desc = "startpage" })
|
||||
|
||||
-- PLUGIN: symbols-outline.nvim
|
||||
map("n", "<leader>so", "<cmd>AerialNavToggle<cr>", { silent = true, desc = "symbol navigator" })
|
||||
map("n", "<leader>sO", "<cmd>AerialToggle<cr>", { silent = true, desc = "symbol outline" })
|
||||
|
||||
-- PLUGIN: nvim-tree
|
||||
map("n", "<leader>se", "<cmd>NvimTreeToggle<cr>", { silent = true, desc = "filetree" })
|
||||
|
||||
-- PLUGIN: nvim-tree
|
||||
map("n", "<leader>sd", "<cmd>Trouble workspace_diagnostics<cr>", { silent = true, desc = "diagnostics workspace" })
|
||||
map("n", "<leader>sD", "<cmd>Trouble document_diagnostics<cr>", { silent = true, desc = "diagnostics document" })
|
||||
|
||||
-- PLUGIN: easy-align
|
||||
-- Start interactive EasyAlign in visual mode (e.g. vipga)
|
||||
map("x", "ga", "<Plug>(EasyAlign)")
|
||||
-- Start interactive EasyAlign for a motion/text object (e.g. gaip)
|
||||
map("n", "ga", "<Plug>(EasyAlign)")
|
||||
|
||||
-- trim trailing whitespaces with mini.nvim trailspace
|
||||
map("n", "<localleader>w", function()
|
||||
require("mini.trailspace").trim()
|
||||
end, { noremap = true })
|
||||
|
||||
-- PLUGIN: dial-increment
|
||||
map("n", "<C-a>", "<Plug>(dial-increment)")
|
||||
map("n", "<C-x>", "<Plug>(dial-decrement)")
|
||||
map("v", "<C-a>", "<Plug>(dial-increment)")
|
||||
map("v", "<C-x>", "<Plug>(dial-increment)")
|
||||
map("v", "g<C-a>", "g<Plug>(dial-increment)")
|
||||
map("v", "g<C-x>", "g<Plug>(dial-increment)")
|
||||
|
||||
-- PLUGIN: zettelkasten.nvim
|
||||
map("n", "<cr>", [[:silent lua require 'zettelkasten'.link_follow()<cr>]])
|
||||
map("v", "<cr>", [[:lua require 'zettelkasten'.link_follow(true)<cr>]])
|
||||
prefix({ ["<leader>n"] = { name = "+notes" } })
|
||||
map("n", "<leader>ni", [[:lua require 'zettelkasten'.index_open()<cr> ]], { desc = "index page" })
|
||||
-- PLUGIN: zk
|
||||
map("n", "<leader>nn", "<cmd>ZkNotes { sort = { 'modified' } }<cr>", { desc = "note list" })
|
||||
map(
|
||||
"n",
|
||||
"<leader>nf",
|
||||
"<Cmd>ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }<CR>",
|
||||
{ desc = "note search" }
|
||||
)
|
||||
map("n", "<leader>nt", "<cmd>ZkTags<cr>", { desc = "note tags" })
|
||||
map("n", "<leader>nc", "<cmd>ZkCd<cr>", { desc = "notes directory" })
|
||||
prefix({ ["<localleader>n"] = { name = "+note" } })
|
||||
map("n", "<localleader>nl", "<cmd>ZkLinks<cr>", { desc = "note links" })
|
||||
map("n", "<localleader>nb", "<cmd>ZkLinks<cr>", { desc = "note backlinks" })
|
||||
map("n", "<localleader>nn", "<cmd>ZkNew { title = vim.fn.input('Title: ') }<cr>", { desc = "new note" })
|
||||
prefix({ ["<localleader>n"] = { name = "+note", mode = "v" } })
|
||||
map("v", "<localleader>nn", ":ZkNewFromTitleSelection<cr>", { desc = "title from selection" })
|
||||
map("v", "<localleader>nN", ":ZkNewFromContentSelection<cr>", { desc = "content from selection" })
|
||||
map("v", "<localleader>nf", ":ZkMatch<cr>", { desc = "find note from selection" })
|
||||
|
||||
-- PLUGIN: toggleterm.nvim
|
||||
-- create a lazygit or python window, set up in toggleterm settings
|
||||
-- TODO create ability to go into python environment when in poetry venv and/or euporie/jupyter notebook
|
||||
map("n", "<leader>sg", ":Lazygit<cr>")
|
||||
map("n", "<leader>sG", ":Lazygit!<cr>")
|
||||
map("n", "<leader>sp", ":Pythonterm<cr>")
|
||||
map("n", "<leader>sP", ":Pythonterm!<cr>")
|
||||
|
||||
prefix({ ["<localleader>s"] = { name = "+set" } })
|
||||
-- PLUGIN: wrapping.nvim
|
||||
map(
|
||||
"n",
|
||||
"<localleader>sw",
|
||||
[[:lua require('wrapping').toggle_wrap_mode()<cr> ]],
|
||||
{ silent = true, desc = "toggle wrap mode" }
|
||||
)
|
||||
|
|
|
@ -85,6 +85,7 @@ local globals = {
|
|||
tex_flavor = "latex",
|
||||
|
||||
disable_autoformat = true, -- only format files manually
|
||||
disable_autolint = false, -- but lint automatically
|
||||
}
|
||||
|
||||
for o, v in pairs(globals) do
|
||||
|
|
|
@ -5,6 +5,43 @@ return {
|
|||
branch = "master",
|
||||
config = true,
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{
|
||||
"<c-w>h",
|
||||
function()
|
||||
require("Navigator").left()
|
||||
end,
|
||||
{ silent = true },
|
||||
},
|
||||
{
|
||||
"<c-w>k",
|
||||
function()
|
||||
require("Navigator").up()
|
||||
end,
|
||||
{ silent = true },
|
||||
},
|
||||
{
|
||||
"<c-w>l",
|
||||
function()
|
||||
require("Navigator").right()
|
||||
end,
|
||||
{ silent = true },
|
||||
},
|
||||
{
|
||||
"<c-w>j",
|
||||
function()
|
||||
require("Navigator").down()
|
||||
end,
|
||||
{ silent = true },
|
||||
},
|
||||
{
|
||||
"<c-w>p",
|
||||
function()
|
||||
require("Navigator").previous()
|
||||
end,
|
||||
{ silent = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
-- jump between letters with improved fFtT quicksearch, mimics sneak
|
||||
{ "ggandor/lightspeed.nvim", event = "BufEnter" },
|
||||
|
@ -24,6 +61,16 @@ return {
|
|||
require("plugins.config.mini")
|
||||
end,
|
||||
event = "VimEnter", -- need to load pretty soon for Starter screen
|
||||
keys = {
|
||||
{ "<leader>sm", ":lua MiniMap.toggle()<cr>", { silent = true, desc = "minimap" } },
|
||||
{ "<leader>ss", ":lua MiniStarter.open()<cr>", { desc = "startpage" } },
|
||||
{
|
||||
"<localleader>w",
|
||||
function()
|
||||
require("mini.trailspace").trim()
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
-- simpler, programmable and multiple terminal toggling for nvim
|
||||
{
|
||||
|
@ -32,22 +79,41 @@ return {
|
|||
require("plugins.config.toggleterm")
|
||||
end,
|
||||
cmd = { "ToggleTerm", "TermExec", "Lazygit", "Pythonterm" },
|
||||
keys = {
|
||||
{ "<leader>sg", ":Lazygit<cr>" },
|
||||
{ "<leader>sG", ":Lazygit!<cr>" },
|
||||
{ "<leader>sp", ":Pythonterm<cr>" },
|
||||
{ "<leader>sP", ":Pythonterm!<cr>" },
|
||||
},
|
||||
},
|
||||
-- colorschemes
|
||||
{
|
||||
"RRethy/nvim-base16",
|
||||
lazy = false,
|
||||
commit = "96e3089",
|
||||
priority = 1000,
|
||||
dependencies = { "rktjmp/fwatch.nvim" },
|
||||
config = function()
|
||||
local colorsfile = vim.fn.stdpath("state") .. "/colorscheme.lua"
|
||||
local function source_colors()
|
||||
if vim.fn.filereadable(colorsfile) == 1 then
|
||||
vim.cmd("source " .. colorsfile)
|
||||
end
|
||||
end
|
||||
-- set on startup
|
||||
source_colors()
|
||||
|
||||
-- continuously watch colors file for changes
|
||||
local fwatch = require("fwatch")
|
||||
fwatch.watch(colorsfile, {
|
||||
on_event = vim.schedule_wrap(function()
|
||||
source_colors()
|
||||
end),
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- try to avoid putting files in util buffers, e.g. filetree, aerial, undotree, ..
|
||||
{
|
||||
"stevearc/stickybuf.nvim",
|
||||
config = true,
|
||||
},
|
||||
{ "stevearc/stickybuf.nvim", config = true },
|
||||
-- make it a little less painful to open really big (>2mb) files by disabling features
|
||||
{
|
||||
"LunarVim/bigfile.nvim",
|
||||
lazy = false,
|
||||
},
|
||||
{ "LunarVim/bigfile.nvim", lazy = false },
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ return {
|
|||
lspFeatures = {
|
||||
enabled = true,
|
||||
languages = { "r", "python", "julia", "bash" },
|
||||
diagnostics = { enabled = true, triggers = { "BufWritePost" } },
|
||||
diagnostics = { enabled = false, triggers = { "BufWritePost" } },
|
||||
completion = { enabled = true },
|
||||
},
|
||||
codeRunner = {
|
||||
|
|
|
@ -7,7 +7,11 @@ return {
|
|||
-- Align tables and other alignable things
|
||||
{
|
||||
"junegunn/vim-easy-align",
|
||||
event = "VeryLazy",
|
||||
event = "InsertEnter",
|
||||
keys = {
|
||||
{ "ga", "<Plug>(EasyAlign)", mode = "n" },
|
||||
{ "ga", "<Plug>(EasyAlign)", mode = "x" },
|
||||
},
|
||||
},
|
||||
-- surround things with other things using ys/cs/ds
|
||||
{ "kylechui/nvim-surround", version = "*", config = true, event = "VeryLazy" },
|
||||
|
@ -48,5 +52,13 @@ return {
|
|||
})
|
||||
end,
|
||||
event = "InsertEnter",
|
||||
keys = {
|
||||
{ "<C-a>", "<Plug>(dial-increment)", mode = "n" },
|
||||
{ "<C-x>", "<Plug>(dial-decrement)", mode = "n" },
|
||||
{ "<C-a>", "<Plug>(dial-increment)", mode = "v" },
|
||||
{ "<C-x>", "<Plug>(dial-increment)", mode = "v" },
|
||||
{ "g<C-a>", "g<Plug>(dial-increment)", mode = "v" },
|
||||
{ "g<C-x>", "g<Plug>(dial-increment)", mode = "v" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -8,11 +8,20 @@ return {
|
|||
vim.g.vifm_exec_args = '-c "set vifminfo=" -c "set statusline=" -c "only"'
|
||||
end,
|
||||
cmd = "Vifm",
|
||||
keys = {
|
||||
{ "<leader>e", "<cmd>Vifm<cr>", desc = "browse files" },
|
||||
{ "<leader>E", ":Vifm getcwd()<cr>", desc = "browse project" },
|
||||
{ "<leader>vc", ":Vifm " .. vim.fn.stdpath("config") .. "/lua<cr>", desc = "open config" },
|
||||
},
|
||||
event = { "BufEnter" },
|
||||
}, -- integrate file manager
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua", -- integrate file tree
|
||||
config = true,
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", config = true },
|
||||
cmd = "NvimTreeToggle",
|
||||
keys = {
|
||||
{ "<leader>se", "<cmd>NvimTreeToggle<cr>", desc = "filetree", silent = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -25,6 +25,10 @@ return {
|
|||
opts = {
|
||||
backends = { "treesitter", "lsp", "markdown", "man" },
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>so", "<cmd>AerialNavToggle<cr>", silent = true, desc = "symbol navigator" },
|
||||
{ "<leader>sO", "<cmd>AerialToggle<cr>", silent = true, desc = "symbol outline" },
|
||||
},
|
||||
},
|
||||
|
||||
-- lsp setup
|
||||
|
@ -55,9 +59,7 @@ return {
|
|||
"williamboman/mason-lspconfig.nvim",
|
||||
cmd = { "LspInstall", "LspUninstall" },
|
||||
},
|
||||
{
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
},
|
||||
{ "WhoIsSethDaniel/mason-tool-installer.nvim" },
|
||||
},
|
||||
event = { "BufRead", "BufNewFile", "InsertEnter" },
|
||||
after = { "nvim-cmp" },
|
||||
|
@ -76,40 +78,24 @@ return {
|
|||
"mfussenegger/nvim-lint",
|
||||
config = function()
|
||||
local linters = {
|
||||
astro = {},
|
||||
bash = {},
|
||||
javascript = {},
|
||||
javascriptreact = {},
|
||||
markdown = {},
|
||||
quarto = {},
|
||||
sh = {},
|
||||
svelte = {},
|
||||
text = {},
|
||||
typescript = {},
|
||||
typescriptreact = {},
|
||||
astro = { "eslint_d" },
|
||||
bash = { "shellcheck" },
|
||||
javascript = { "eslint_d" },
|
||||
javascriptreact = { "eslint_d" },
|
||||
markdown = { "markdownlint", "vale" },
|
||||
quarto = { "markdownlint", "vale" },
|
||||
sh = { "shellcheck" },
|
||||
svelte = { "eslint_d" },
|
||||
text = { "vale" },
|
||||
typescript = { "eslint_d" },
|
||||
typescriptreact = { "eslint_d" },
|
||||
}
|
||||
local per_cmd = function(cmd, ft_table)
|
||||
if vim.fn.executable(cmd) == 1 then
|
||||
for _, v in pairs(ft_table) do
|
||||
table.insert(v, cmd)
|
||||
end
|
||||
end
|
||||
end
|
||||
per_cmd("markdownlint", { linters.markdown, linters.quarto })
|
||||
per_cmd("vale", { linters.markdown, linters.text, linters.quarto })
|
||||
per_cmd("shellcheck", { linters.sh, linters.bash })
|
||||
per_cmd("eslint_d", {
|
||||
linters.astro,
|
||||
linters.javascript,
|
||||
linters.javascriptreact,
|
||||
linters.svelte,
|
||||
linters.typescript,
|
||||
linters.typescriptreact,
|
||||
})
|
||||
require("lint").linters_by_ft = linters
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost", "InsertLeave" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
if not vim.g.disable_autoformat then
|
||||
require("lint").try_lint()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
@ -247,6 +233,10 @@ return {
|
|||
"TroubleToggle",
|
||||
"TroubleClose",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>sd", "<cmd>Trouble workspace_diagnostics<cr>", silent = true, desc = "diagnostics workspace" },
|
||||
{ "<leader>sD", "<cmd>Trouble document_diagnostics<cr>", silent = true, desc = "diagnostics document" },
|
||||
},
|
||||
},
|
||||
|
||||
-- testing setup
|
||||
|
@ -268,9 +258,8 @@ return {
|
|||
}),
|
||||
},
|
||||
})
|
||||
local status, wk = pcall(require, "which-key")
|
||||
if status then
|
||||
wk.register({ ["<localleader>t"] = { name = "+test" } })
|
||||
if require("util").is_available("which-key") then
|
||||
require("which-key").register({ ["<localleader>t"] = { name = "+test" } })
|
||||
end
|
||||
end,
|
||||
ft = { "python" },
|
||||
|
|
|
@ -3,17 +3,42 @@ local writing_ft = { "quarto", "pandoc", "markdown", "text", "tex" }
|
|||
local prose_plugs = {
|
||||
-- UI improvements
|
||||
-- provide distraction free writing
|
||||
{ "folke/zen-mode.nvim", config = true, cmd = { "ZenMode" }, dependencies = { "folke/twilight.nvim" } },
|
||||
{
|
||||
"folke/zen-mode.nvim",
|
||||
config = true,
|
||||
cmd = { "ZenMode" },
|
||||
dependencies = { "folke/twilight.nvim" },
|
||||
keys = { { "<leader>sz", ":ZenMode<cr>", { silent = true } } },
|
||||
},
|
||||
{
|
||||
"andrewferrier/wrapping.nvim",
|
||||
config = function()
|
||||
require("wrapping").setup({
|
||||
create_keymappings = false,
|
||||
notify_on_switch = false,
|
||||
softener = { markdown = true, text = true, asciidoc = true },
|
||||
})
|
||||
end,
|
||||
lazy = false,
|
||||
opts = {
|
||||
create_keymappings = false,
|
||||
notify_on_switch = false,
|
||||
softener = { quarto = true, markdown = true, text = true, asciidoc = true },
|
||||
auto_set_mode_filetype_allowlist = {
|
||||
"asciidoc",
|
||||
"gitcommit",
|
||||
"latex",
|
||||
"mail",
|
||||
"markdown",
|
||||
"rst",
|
||||
"tex",
|
||||
"text",
|
||||
"quarto",
|
||||
},
|
||||
},
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
keys = {
|
||||
{
|
||||
"<localleader>sw",
|
||||
function()
|
||||
require("wrapping").toggle_wrap_mode()
|
||||
end,
|
||||
silent = true,
|
||||
desc = "toggle wrap mode",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- displays prettier headlines mimicking the ones in emacs orgmode
|
||||
{
|
||||
|
@ -35,6 +60,12 @@ local prose_plugs = {
|
|||
{
|
||||
"mickael-menu/zk-nvim",
|
||||
config = function()
|
||||
if require("util").is_available("which-key") then
|
||||
local prefix = require("which-key").register
|
||||
prefix({ ["<leader>n"] = { name = "+notes" } })
|
||||
prefix({ ["<localleader>n"] = { name = "+note" } })
|
||||
prefix({ ["<localleader>n"] = { name = "+note", mode = "v" } })
|
||||
end
|
||||
require("zk").setup({ picker = "telescope" })
|
||||
end,
|
||||
ft = writing_ft,
|
||||
|
@ -52,9 +83,51 @@ local prose_plugs = {
|
|||
"ZkNotes",
|
||||
"ZkTags",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>nn", "<cmd>ZkNotes { sort = { 'modified' } }<cr>", desc = "note list" },
|
||||
{
|
||||
"<leader>nf",
|
||||
"<Cmd>ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }<CR>",
|
||||
desc = "note search",
|
||||
},
|
||||
{ "<leader>nt", "<cmd>ZkTags<cr>", desc = "note tags" },
|
||||
{ "<leader>nc", "<cmd>ZkCd<cr>", desc = "notes directory" },
|
||||
{ "<localleader>nl", "<cmd>ZkLinks<cr>", desc = "note links" },
|
||||
{ "<localleader>nb", "<cmd>ZkLinks<cr>", desc = "note backlinks" },
|
||||
{ "<localleader>nn", "<cmd>ZkNew { title = vim.fn.input('Title: ') }<cr>", desc = "new note" },
|
||||
{ "<localleader>nn", ":ZkNewFromTitleSelection<cr>", desc = "title from selection", mode = "v" },
|
||||
{ "<localleader>nN", ":ZkNewFromContentSelection<cr>", desc = "content from selection", mode = "v" },
|
||||
{ "<localleader>nf", ":ZkMatch<cr>", desc = "find note from selection", mode = "v" },
|
||||
},
|
||||
},
|
||||
-- simple static markdown linking and link following using zettel IDs
|
||||
{ "marty-oehme/zettelkasten.nvim", ft = writing_ft, event = "VeryLazy" },
|
||||
{
|
||||
"marty-oehme/zettelkasten.nvim",
|
||||
ft = writing_ft,
|
||||
keys = {
|
||||
{
|
||||
"<cr>",
|
||||
function()
|
||||
require("zettelkasten").link_follow()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<cr>",
|
||||
function()
|
||||
require("zettelkasten").link_follow(true)
|
||||
end,
|
||||
mode = "v",
|
||||
},
|
||||
{
|
||||
"<leader>ni",
|
||||
function()
|
||||
require("zettelkasten").index_open()
|
||||
end,
|
||||
desc = "index page",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- syntax highlighting for markdown criticmarkup (comments, additions, ...)
|
||||
{ "vim-pandoc/vim-criticmarkup", ft = writing_ft },
|
||||
|
|
|
@ -7,9 +7,11 @@ return {
|
|||
"nvim-lua/plenary.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
},
|
||||
event = "VeryLazy",
|
||||
cmd = "Telescope",
|
||||
config = function()
|
||||
if require("util").is_available("which-key") then
|
||||
require("which-key").register({ ["<leader>f"] = { name = "+find" } })
|
||||
end
|
||||
-- Setup up telescope fuzzy finding settings
|
||||
--
|
||||
-- Makes use of optionally installed external programs to work fully:
|
||||
|
@ -44,26 +46,8 @@ return {
|
|||
borderchars = {
|
||||
{ "─", "│", "─", "│", "┌", "┐", "┘", "└" },
|
||||
prompt = { "─", "│", " ", "│", "┌", "┐", "│", "│" },
|
||||
results = {
|
||||
"─",
|
||||
"│",
|
||||
"─",
|
||||
"│",
|
||||
"├",
|
||||
"┤",
|
||||
"┘",
|
||||
"└",
|
||||
},
|
||||
preview = {
|
||||
"─",
|
||||
"│",
|
||||
"─",
|
||||
"│",
|
||||
"┌",
|
||||
"┐",
|
||||
"┘",
|
||||
"└",
|
||||
},
|
||||
results = { "─", "│", "─", "│", "├", "┤", "┘", "└" },
|
||||
preview = { "─", "│", "─", "│", "┌", "┐", "┘", "└" },
|
||||
},
|
||||
width = 0.8,
|
||||
previewer = false,
|
||||
|
@ -73,5 +57,92 @@ return {
|
|||
})
|
||||
require("telescope").load_extension("fzf")
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>vh",
|
||||
function()
|
||||
require("telescope.builtin").help_tags()
|
||||
end,
|
||||
desc = "help tags",
|
||||
},
|
||||
{
|
||||
"<leader>vH",
|
||||
function()
|
||||
require("telescope.builtin").man_pages()
|
||||
end,
|
||||
desc = "man pages",
|
||||
},
|
||||
{
|
||||
"<leader>vC",
|
||||
function()
|
||||
require("telescope.builtin").colorscheme(require("telescope.themes").get_ivy())
|
||||
end,
|
||||
desc = "colorschemes" ,
|
||||
},
|
||||
|
||||
{
|
||||
"<leader>fb",
|
||||
function()
|
||||
require("telescope.builtin").buffers(require("telescope.themes").get_ivy())
|
||||
end,
|
||||
desc = "list buffers",
|
||||
},
|
||||
{
|
||||
"<leader>fo",
|
||||
function()
|
||||
require("telescope.builtin").oldfiles(require("telescope.themes").get_ivy())
|
||||
end,
|
||||
desc = "list old files",
|
||||
},
|
||||
{
|
||||
"<leader>ff",
|
||||
function()
|
||||
require("telescope.builtin").find_files()
|
||||
end,
|
||||
desc = "find files",
|
||||
},
|
||||
{
|
||||
"<leader>fh",
|
||||
function()
|
||||
require("telescope.builtin").find_files({ hidden = true })
|
||||
end,
|
||||
desc = "find hidden files",
|
||||
},
|
||||
{
|
||||
"<leader>fw",
|
||||
function()
|
||||
require("telescope.builtin").live_grep()
|
||||
end,
|
||||
desc = "grep search",
|
||||
},
|
||||
{
|
||||
"<leader>fg",
|
||||
function()
|
||||
require("telescope.builtin").git_status()
|
||||
end,
|
||||
desc = "git status",
|
||||
},
|
||||
{
|
||||
"<leader>fc",
|
||||
function()
|
||||
require("telescope.builtin").git_bcommits()
|
||||
end,
|
||||
desc = "git buffer commits",
|
||||
},
|
||||
{
|
||||
"<leader>fl",
|
||||
function()
|
||||
require("telescope.builtin").git_commits()
|
||||
end,
|
||||
desc = "git commit log",
|
||||
},
|
||||
{
|
||||
"z=",
|
||||
function()
|
||||
require("telescope.builtin").spell_suggest(require("telescope.themes").get_ivy())
|
||||
end,
|
||||
desc = "spell suggest",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,27 +1,29 @@
|
|||
local util = require("lspconfig.util")
|
||||
local path = util.path
|
||||
local T = {}
|
||||
local exepath = vim.fn.exepath
|
||||
|
||||
local function path_join(...)
|
||||
return table.concat(vim.tbl_flatten { ... }, '/')
|
||||
end
|
||||
|
||||
-- from https://github.com/ray-x/navigator.lua/issues/247#issue-1465308677
|
||||
T.get_path = function(workspace)
|
||||
-- Use activated virtualenv.
|
||||
if vim.env.VIRTUAL_ENV then
|
||||
return path.join(vim.env.VIRTUAL_ENV, "bin", "python")
|
||||
return path_join(vim.env.VIRTUAL_ENV, "bin", "python")
|
||||
end
|
||||
|
||||
-- Find and use virtualenv in workspace directory.
|
||||
for _, pattern in ipairs({ "*", ".*" }) do
|
||||
local match = vim.fn.glob(path.join(workspace, pattern, "pyvenv.cfg"))
|
||||
local match = vim.fn.glob(path_join(workspace, pattern, "pyvenv.cfg"))
|
||||
if match ~= "" then
|
||||
local py = path.join("bin", "python")
|
||||
local py = path_join("bin", "python")
|
||||
match = string.gsub(match, "pyvenv.cfg", py)
|
||||
return match
|
||||
end
|
||||
match = vim.fn.glob(path.join(workspace, pattern, "poetry.lock"))
|
||||
match = vim.fn.glob(path_join(workspace, pattern, "poetry.lock"))
|
||||
if match ~= "" then
|
||||
local venv_base_folder = vim.fn.trim(vim.fn.system("poetry env info -p"))
|
||||
return path.join(venv_base_folder, "bin", "python")
|
||||
return path_join(venv_base_folder, "bin", "python")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -206,3 +206,6 @@ ppt
|
|||
Programo
|
||||
Urbano
|
||||
redistributional
|
||||
HIC
|
||||
LMIC
|
||||
hukou
|
||||
|
|
|
@ -16,9 +16,6 @@ t() {
|
|||
# works for now. from here: https://unix.stackexchange.com/a/72564/414758
|
||||
if exist task && [ "$(ps -p $$ -o comm --no-headers)" = "zsh" ]; then compdef t=task; fi
|
||||
|
||||
# Make taskopen XDG conforming. If changing here, also change in taskrc alias.
|
||||
alias taskopen='taskopen --config=${XDG_CONFIG_HOME:-~/.config}/task/taskopenrc'
|
||||
|
||||
alias ta="task add"
|
||||
alias tal="task log"
|
||||
alias tan="task annotate"
|
||||
|
|
|
@ -7,7 +7,7 @@ path_ext = /usr/share/taskopen/scripts
|
|||
note_custom_ext.regex = "^Note\\.?(.*)?"
|
||||
note_custom_ext.command = "$EDITOR ${XDG_DATA_HOME:-$HOME/.local/share}/task/notes/$UUID.$LAST_MATCH"
|
||||
|
||||
notes.regex = "^Note"
|
||||
notes.regex = "^Note$"
|
||||
notes.command = "$EDITOR ${XDG_DATA_HOME:-$HOME/.local/share}/task/notes/$UUID.md"
|
||||
|
||||
links.regex = "^https?://"
|
||||
|
|
|
@ -23,7 +23,7 @@ weekstart=monday
|
|||
|
||||
# Make daily burndown default alias
|
||||
alias.burndown=burndown.daily
|
||||
alias.open=exec taskopen "--config=${XDG_CONFIG_HOME:-$HOME/.config}/task/taskopenrc"
|
||||
alias.open=exec taskopen
|
||||
|
||||
# Sort the columns a little differently
|
||||
active.indicator=>
|
||||
|
|
|
@ -12,18 +12,25 @@ CONFDIR="${XDG_CONFIG_HOME:-$HOME/.config}"
|
|||
[ -f "$CONFDIR/sh/alias" ] && source "$CONFDIR/sh/alias"
|
||||
# load additional aliases
|
||||
if [ -d "$CONFDIR/sh/alias.d" ]; then
|
||||
for _alias in "$CONFDIR/sh/alias.d"/*.sh; do
|
||||
. "$_alias"
|
||||
done
|
||||
unset _alias
|
||||
for _alias in "$CONFDIR/sh/alias.d"/*.sh; do
|
||||
. "$_alias"
|
||||
done
|
||||
unset _alias
|
||||
fi
|
||||
if [ -d "$CONFDIR/bash/alias.d" ]; then
|
||||
for _alias in "$CONFDIR/bash/alias.d"/*.sh; do
|
||||
. "$_alias"
|
||||
done
|
||||
unset _alias
|
||||
for _alias in "$CONFDIR/bash/alias.d"/*.sh; do
|
||||
. "$_alias"
|
||||
done
|
||||
unset _alias
|
||||
fi
|
||||
|
||||
eval "$(zoxide init bash)"
|
||||
alias ls='ls --color=auto'
|
||||
PS1='[\u@\h \W]\$ '
|
||||
|
||||
eval "$(starship init bash)"
|
||||
eval "$(zoxide init bash)"
|
||||
|
||||
set -o vi
|
||||
stty time 0
|
||||
bind 'set keyseq-timeout 1'
|
||||
|
||||
eval "$(atuin init bash)"
|
||||
|
|
769
terminal/.config/nushell/config.nu
Normal file
769
terminal/.config/nushell/config.nu
Normal file
|
@ -0,0 +1,769 @@
|
|||
# Nushell Config File
|
||||
#
|
||||
# version = "0.87.1"
|
||||
|
||||
# For more information on defining custom themes, see
|
||||
# https://www.nushell.sh/book/coloring_and_theming.html
|
||||
# And here is the theme collection
|
||||
# https://github.com/nushell/nu_scripts/tree/main/themes
|
||||
let dark_theme = {
|
||||
# color for nushell primitives
|
||||
separator: white
|
||||
leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
|
||||
header: green_bold
|
||||
empty: blue
|
||||
# Closures can be used to choose colors for specific values.
|
||||
# The value (in this case, a bool) is piped into the closure.
|
||||
# eg) {|| if $in { 'light_cyan' } else { 'light_gray' } }
|
||||
bool: light_cyan
|
||||
int: white
|
||||
filesize: cyan
|
||||
duration: white
|
||||
date: purple
|
||||
range: white
|
||||
float: white
|
||||
string: white
|
||||
nothing: white
|
||||
binary: white
|
||||
cell-path: white
|
||||
row_index: green_bold
|
||||
record: white
|
||||
list: white
|
||||
block: white
|
||||
hints: dark_gray
|
||||
search_result: {bg: red fg: white}
|
||||
shape_and: purple_bold
|
||||
shape_binary: purple_bold
|
||||
shape_block: blue_bold
|
||||
shape_bool: light_cyan
|
||||
shape_closure: green_bold
|
||||
shape_custom: green
|
||||
shape_datetime: cyan_bold
|
||||
shape_directory: cyan
|
||||
shape_external: cyan
|
||||
shape_externalarg: green_bold
|
||||
shape_filepath: cyan
|
||||
shape_flag: blue_bold
|
||||
shape_float: purple_bold
|
||||
# shapes are used to change the cli syntax highlighting
|
||||
shape_garbage: { fg: white bg: red attr: b}
|
||||
shape_globpattern: cyan_bold
|
||||
shape_int: purple_bold
|
||||
shape_internalcall: cyan_bold
|
||||
shape_keyword: cyan_bold
|
||||
shape_list: cyan_bold
|
||||
shape_literal: blue
|
||||
shape_match_pattern: green
|
||||
shape_matching_brackets: { attr: u }
|
||||
shape_nothing: light_cyan
|
||||
shape_operator: yellow
|
||||
shape_or: purple_bold
|
||||
shape_pipe: purple_bold
|
||||
shape_range: yellow_bold
|
||||
shape_record: cyan_bold
|
||||
shape_redirection: purple_bold
|
||||
shape_signature: green_bold
|
||||
shape_string: green
|
||||
shape_string_interpolation: cyan_bold
|
||||
shape_table: blue_bold
|
||||
shape_variable: purple
|
||||
shape_vardecl: purple
|
||||
}
|
||||
|
||||
let light_theme = {
|
||||
# color for nushell primitives
|
||||
separator: dark_gray
|
||||
leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
|
||||
header: green_bold
|
||||
empty: blue
|
||||
# Closures can be used to choose colors for specific values.
|
||||
# The value (in this case, a bool) is piped into the closure.
|
||||
# eg) {|| if $in { 'dark_cyan' } else { 'dark_gray' } }
|
||||
bool: dark_cyan
|
||||
int: dark_gray
|
||||
filesize: cyan_bold
|
||||
duration: dark_gray
|
||||
date: purple
|
||||
range: dark_gray
|
||||
float: dark_gray
|
||||
string: dark_gray
|
||||
nothing: dark_gray
|
||||
binary: dark_gray
|
||||
cell-path: dark_gray
|
||||
row_index: green_bold
|
||||
record: dark_gray
|
||||
list: dark_gray
|
||||
block: dark_gray
|
||||
hints: dark_gray
|
||||
search_result: {fg: white bg: red}
|
||||
shape_and: purple_bold
|
||||
shape_binary: purple_bold
|
||||
shape_block: blue_bold
|
||||
shape_bool: light_cyan
|
||||
shape_closure: green_bold
|
||||
shape_custom: green
|
||||
shape_datetime: cyan_bold
|
||||
shape_directory: cyan
|
||||
shape_external: cyan
|
||||
shape_externalarg: green_bold
|
||||
shape_filepath: cyan
|
||||
shape_flag: blue_bold
|
||||
shape_float: purple_bold
|
||||
# shapes are used to change the cli syntax highlighting
|
||||
shape_garbage: { fg: white bg: red attr: b}
|
||||
shape_globpattern: cyan_bold
|
||||
shape_int: purple_bold
|
||||
shape_internalcall: cyan_bold
|
||||
shape_keyword: cyan_bold
|
||||
shape_list: cyan_bold
|
||||
shape_literal: blue
|
||||
shape_match_pattern: green
|
||||
shape_matching_brackets: { attr: u }
|
||||
shape_nothing: light_cyan
|
||||
shape_operator: yellow
|
||||
shape_or: purple_bold
|
||||
shape_pipe: purple_bold
|
||||
shape_range: yellow_bold
|
||||
shape_record: cyan_bold
|
||||
shape_redirection: purple_bold
|
||||
shape_signature: green_bold
|
||||
shape_string: green
|
||||
shape_string_interpolation: cyan_bold
|
||||
shape_table: blue_bold
|
||||
shape_variable: purple
|
||||
shape_vardecl: purple
|
||||
}
|
||||
|
||||
# External completer example
|
||||
# let carapace_completer = {|spans|
|
||||
# carapace $spans.0 nushell $spans | from json
|
||||
# }
|
||||
|
||||
# The default config record. This is where much of your global configuration is setup.
|
||||
$env.config = {
|
||||
show_banner: false # true or false to enable or disable the welcome banner at startup
|
||||
|
||||
ls: {
|
||||
use_ls_colors: true # use the LS_COLORS environment variable to colorize output
|
||||
clickable_links: true # enable or disable clickable links. Your terminal has to support links.
|
||||
}
|
||||
|
||||
rm: {
|
||||
always_trash: false # always act as if -t was given. Can be overridden with -p
|
||||
}
|
||||
|
||||
table: {
|
||||
mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
|
||||
index_mode: always # "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column
|
||||
show_empty: true # show 'empty list' and 'empty record' placeholders for command output
|
||||
padding: { left: 1, right: 1 } # a left right padding of each column in a table
|
||||
trim: {
|
||||
methodology: wrapping # wrapping or truncating
|
||||
wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology
|
||||
truncating_suffix: "..." # A suffix used by the 'truncating' methodology
|
||||
}
|
||||
header_on_separator: false # show header text on separator/border line
|
||||
# abbreviated_row_count: 10 # limit data rows from top and bottom after reaching a set point
|
||||
}
|
||||
|
||||
error_style: "fancy" # "fancy" or "plain" for screen reader-friendly error messages
|
||||
|
||||
# datetime_format determines what a datetime rendered in the shell would look like.
|
||||
# Behavior without this configuration point will be to "humanize" the datetime display,
|
||||
# showing something like "a day ago."
|
||||
datetime_format: {
|
||||
# normal: '%a, %d %b %Y %H:%M:%S %z' # shows up in displays of variables or other datetime's outside of tables
|
||||
# table: '%m/%d/%y %I:%M:%S%p' # generally shows up in tabular outputs such as ls. commenting this out will change it to the default human readable datetime format
|
||||
}
|
||||
|
||||
explore: {
|
||||
status_bar_background: {fg: "#1D1F21", bg: "#C4C9C6"},
|
||||
command_bar_text: {fg: "#C4C9C6"},
|
||||
highlight: {fg: "black", bg: "yellow"},
|
||||
status: {
|
||||
error: {fg: "white", bg: "red"},
|
||||
warn: {}
|
||||
info: {}
|
||||
},
|
||||
table: {
|
||||
split_line: {fg: "#404040"},
|
||||
selected_cell: {bg: light_blue},
|
||||
selected_row: {},
|
||||
selected_column: {},
|
||||
},
|
||||
}
|
||||
|
||||
history: {
|
||||
max_size: 100_000 # Session has to be reloaded for this to take effect
|
||||
sync_on_enter: true # Enable to share history between multiple sessions, else you have to close the session to write history to file
|
||||
file_format: "plaintext" # "sqlite" or "plaintext"
|
||||
isolation: false # only available with sqlite file_format. true enables history isolation, false disables it. true will allow the history to be isolated to the current session using up/down arrows. false will allow the history to be shared across all sessions.
|
||||
}
|
||||
|
||||
completions: {
|
||||
case_sensitive: false # set to true to enable case-sensitive completions
|
||||
quick: true # set this to false to prevent auto-selecting completions when only one remains
|
||||
partial: true # set this to false to prevent partial filling of the prompt
|
||||
algorithm: "fuzzy" # prefix or fuzzy
|
||||
external: {
|
||||
enable: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up may be very slow
|
||||
max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options
|
||||
completer: null # check 'carapace_completer' above as an example
|
||||
}
|
||||
}
|
||||
|
||||
filesize: {
|
||||
metric: true # true => KB, MB, GB (ISO standard), false => KiB, MiB, GiB (Windows standard)
|
||||
format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, auto
|
||||
}
|
||||
|
||||
cursor_shape: {
|
||||
emacs: line # block, underscore, line, blink_block, blink_underscore, blink_line, inherit to skip setting cursor shape (line is the default)
|
||||
vi_insert: line # block, underscore, line, blink_block, blink_underscore, blink_line, inherit to skip setting cursor shape (block is the default)
|
||||
vi_normal: block # block, underscore, line, blink_block, blink_underscore, blink_line, inherit to skip setting cursor shape (underscore is the default)
|
||||
}
|
||||
|
||||
color_config: $dark_theme # if you want a more interesting theme, you can replace the empty record with `$dark_theme`, `$light_theme` or another custom record
|
||||
use_grid_icons: true
|
||||
footer_mode: "25" # always, never, number_of_rows, auto
|
||||
float_precision: 2 # the precision for displaying floats in tables
|
||||
buffer_editor: "" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
|
||||
use_ansi_coloring: true
|
||||
bracketed_paste: true # enable bracketed paste, currently useless on windows
|
||||
edit_mode: vi # emacs, vi
|
||||
shell_integration: true # enables terminal shell integration. Off by default, as some terminals have issues with this.
|
||||
render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt.
|
||||
use_kitty_protocol: false # enables keyboard enhancement protocol implemented by kitty console, only if your terminal support this
|
||||
|
||||
hooks: {
|
||||
pre_prompt: [{ null }] # run before the prompt is shown
|
||||
pre_execution: [{ null }] # run before the repl input is run
|
||||
env_change: {
|
||||
PWD: [{|before, after| null }] # run if the PWD environment is different since the last repl input
|
||||
}
|
||||
display_output: "if (term size).columns >= 100 { table -e } else { table }" # run to display the output of a pipeline
|
||||
command_not_found: { null } # return an error message when a command is not found
|
||||
}
|
||||
|
||||
menus: [
|
||||
# Configuration for default nushell menus
|
||||
# Note the lack of source parameter
|
||||
{
|
||||
name: completion_menu
|
||||
only_buffer_difference: false
|
||||
marker: "| "
|
||||
type: {
|
||||
layout: columnar
|
||||
columns: 4
|
||||
col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
|
||||
col_padding: 2
|
||||
}
|
||||
style: {
|
||||
text: green
|
||||
selected_text: green_reverse
|
||||
description_text: yellow
|
||||
}
|
||||
}
|
||||
{
|
||||
name: history_menu
|
||||
only_buffer_difference: true
|
||||
marker: "? "
|
||||
type: {
|
||||
layout: list
|
||||
page_size: 10
|
||||
}
|
||||
style: {
|
||||
text: green
|
||||
selected_text: green_reverse
|
||||
description_text: yellow
|
||||
}
|
||||
}
|
||||
{
|
||||
name: help_menu
|
||||
only_buffer_difference: true
|
||||
marker: "? "
|
||||
type: {
|
||||
layout: description
|
||||
columns: 4
|
||||
col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
|
||||
col_padding: 2
|
||||
selection_rows: 4
|
||||
description_rows: 10
|
||||
}
|
||||
style: {
|
||||
text: green
|
||||
selected_text: green_reverse
|
||||
description_text: yellow
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
keybindings: [
|
||||
{
|
||||
name: completion_menu
|
||||
modifier: none
|
||||
keycode: tab
|
||||
mode: [emacs vi_normal vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{ send: menu name: completion_menu }
|
||||
{ send: menunext }
|
||||
{ edit: complete }
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: history_menu
|
||||
modifier: control
|
||||
keycode: char_r
|
||||
mode: [emacs, vi_insert, vi_normal]
|
||||
event: { send: menu name: history_menu }
|
||||
}
|
||||
{
|
||||
name: help_menu
|
||||
modifier: none
|
||||
keycode: f1
|
||||
mode: [emacs, vi_insert, vi_normal]
|
||||
event: { send: menu name: help_menu }
|
||||
}
|
||||
{
|
||||
name: completion_previous_menu
|
||||
modifier: shift
|
||||
keycode: backtab
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: menuprevious }
|
||||
}
|
||||
{
|
||||
name: next_page_menu
|
||||
modifier: control
|
||||
keycode: char_x
|
||||
mode: emacs
|
||||
event: { send: menupagenext }
|
||||
}
|
||||
{
|
||||
name: undo_or_previous_page_menu
|
||||
modifier: control
|
||||
keycode: char_z
|
||||
mode: emacs
|
||||
event: {
|
||||
until: [
|
||||
{ send: menupageprevious }
|
||||
{ edit: undo }
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: escape
|
||||
modifier: none
|
||||
keycode: escape
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: esc } # NOTE: does not appear to work
|
||||
}
|
||||
{
|
||||
name: cancel_command
|
||||
modifier: control
|
||||
keycode: char_c
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: ctrlc }
|
||||
}
|
||||
{
|
||||
name: quit_shell
|
||||
modifier: control
|
||||
keycode: char_d
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: ctrld }
|
||||
}
|
||||
{
|
||||
name: clear_screen
|
||||
modifier: control
|
||||
keycode: char_l
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: clearscreen }
|
||||
}
|
||||
{
|
||||
name: search_history
|
||||
modifier: control
|
||||
keycode: char_q
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: searchhistory }
|
||||
}
|
||||
{
|
||||
name: open_command_editor
|
||||
modifier: control
|
||||
keycode: char_o
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: openeditor }
|
||||
}
|
||||
{
|
||||
name: move_up
|
||||
modifier: none
|
||||
keycode: up
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menuup}
|
||||
{send: up}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_down
|
||||
modifier: none
|
||||
keycode: down
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menudown}
|
||||
{send: down}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_left
|
||||
modifier: none
|
||||
keycode: left
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menuleft}
|
||||
{send: left}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_right_or_take_history_hint
|
||||
modifier: none
|
||||
keycode: right
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintcomplete}
|
||||
{send: menuright}
|
||||
{send: right}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_one_word_left
|
||||
modifier: control
|
||||
keycode: left
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {edit: movewordleft}
|
||||
}
|
||||
{
|
||||
name: move_one_word_right_or_take_history_hint
|
||||
modifier: control
|
||||
keycode: right
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintwordcomplete}
|
||||
{edit: movewordright}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_to_line_start
|
||||
modifier: none
|
||||
keycode: home
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {edit: movetolinestart}
|
||||
}
|
||||
{
|
||||
name: move_to_line_start
|
||||
modifier: control
|
||||
keycode: char_a
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {edit: movetolinestart}
|
||||
}
|
||||
{
|
||||
name: move_to_line_end_or_take_history_hint
|
||||
modifier: none
|
||||
keycode: end
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintcomplete}
|
||||
{edit: movetolineend}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_to_line_end_or_take_history_hint
|
||||
modifier: control
|
||||
keycode: char_e
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintcomplete}
|
||||
{edit: movetolineend}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_to_line_start
|
||||
modifier: control
|
||||
keycode: home
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {edit: movetolinestart}
|
||||
}
|
||||
{
|
||||
name: move_to_line_end
|
||||
modifier: control
|
||||
keycode: end
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {edit: movetolineend}
|
||||
}
|
||||
{
|
||||
name: move_up
|
||||
modifier: control
|
||||
keycode: char_p
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menuup}
|
||||
{send: up}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_down
|
||||
modifier: control
|
||||
keycode: char_t
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
until: [
|
||||
{send: menudown}
|
||||
{send: down}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: delete_one_character_backward
|
||||
modifier: none
|
||||
keycode: backspace
|
||||
mode: [emacs, vi_insert]
|
||||
event: {edit: backspace}
|
||||
}
|
||||
{
|
||||
name: delete_one_word_backward
|
||||
modifier: control
|
||||
keycode: backspace
|
||||
mode: [emacs, vi_insert]
|
||||
event: {edit: backspaceword}
|
||||
}
|
||||
{
|
||||
name: delete_one_character_forward
|
||||
modifier: none
|
||||
keycode: delete
|
||||
mode: [emacs, vi_insert]
|
||||
event: {edit: delete}
|
||||
}
|
||||
{
|
||||
name: delete_one_character_forward
|
||||
modifier: control
|
||||
keycode: delete
|
||||
mode: [emacs, vi_insert]
|
||||
event: {edit: delete}
|
||||
}
|
||||
{
|
||||
name: delete_one_character_forward
|
||||
modifier: control
|
||||
keycode: char_h
|
||||
mode: [emacs, vi_insert]
|
||||
event: {edit: backspace}
|
||||
}
|
||||
{
|
||||
name: delete_one_word_backward
|
||||
modifier: control
|
||||
keycode: char_w
|
||||
mode: [emacs, vi_insert]
|
||||
event: {edit: backspaceword}
|
||||
}
|
||||
{
|
||||
name: move_left
|
||||
modifier: none
|
||||
keycode: backspace
|
||||
mode: vi_normal
|
||||
event: {edit: moveleft}
|
||||
}
|
||||
{
|
||||
name: newline_or_run_command
|
||||
modifier: none
|
||||
keycode: enter
|
||||
mode: emacs
|
||||
event: {send: enter}
|
||||
}
|
||||
{
|
||||
name: move_left
|
||||
modifier: control
|
||||
keycode: char_b
|
||||
mode: emacs
|
||||
event: {
|
||||
until: [
|
||||
{send: menuleft}
|
||||
{send: left}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_right_or_take_history_hint
|
||||
modifier: control
|
||||
keycode: char_f
|
||||
mode: emacs
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintcomplete}
|
||||
{send: menuright}
|
||||
{send: right}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: redo_change
|
||||
modifier: control
|
||||
keycode: char_g
|
||||
mode: emacs
|
||||
event: {edit: redo}
|
||||
}
|
||||
{
|
||||
name: undo_change
|
||||
modifier: control
|
||||
keycode: char_z
|
||||
mode: emacs
|
||||
event: {edit: undo}
|
||||
}
|
||||
{
|
||||
name: paste_before
|
||||
modifier: control
|
||||
keycode: char_y
|
||||
mode: emacs
|
||||
event: {edit: pastecutbufferbefore}
|
||||
}
|
||||
{
|
||||
name: cut_word_left
|
||||
modifier: control
|
||||
keycode: char_w
|
||||
mode: emacs
|
||||
event: {edit: cutwordleft}
|
||||
}
|
||||
{
|
||||
name: cut_line_to_end
|
||||
modifier: control
|
||||
keycode: char_k
|
||||
mode: emacs
|
||||
event: {edit: cuttoend}
|
||||
}
|
||||
{
|
||||
name: cut_line_from_start
|
||||
modifier: control
|
||||
keycode: char_u
|
||||
mode: emacs
|
||||
event: {edit: cutfromstart}
|
||||
}
|
||||
{
|
||||
name: swap_graphemes
|
||||
modifier: control
|
||||
keycode: char_t
|
||||
mode: emacs
|
||||
event: {edit: swapgraphemes}
|
||||
}
|
||||
{
|
||||
name: move_one_word_left
|
||||
modifier: alt
|
||||
keycode: left
|
||||
mode: emacs
|
||||
event: {edit: movewordleft}
|
||||
}
|
||||
{
|
||||
name: move_one_word_right_or_take_history_hint
|
||||
modifier: alt
|
||||
keycode: right
|
||||
mode: emacs
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintwordcomplete}
|
||||
{edit: movewordright}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: move_one_word_left
|
||||
modifier: alt
|
||||
keycode: char_b
|
||||
mode: emacs
|
||||
event: {edit: movewordleft}
|
||||
}
|
||||
{
|
||||
name: move_one_word_right_or_take_history_hint
|
||||
modifier: alt
|
||||
keycode: char_f
|
||||
mode: emacs
|
||||
event: {
|
||||
until: [
|
||||
{send: historyhintwordcomplete}
|
||||
{edit: movewordright}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
name: delete_one_word_forward
|
||||
modifier: alt
|
||||
keycode: delete
|
||||
mode: emacs
|
||||
event: {edit: deleteword}
|
||||
}
|
||||
{
|
||||
name: delete_one_word_backward
|
||||
modifier: alt
|
||||
keycode: backspace
|
||||
mode: emacs
|
||||
event: {edit: backspaceword}
|
||||
}
|
||||
{
|
||||
name: delete_one_word_backward
|
||||
modifier: alt
|
||||
keycode: char_m
|
||||
mode: emacs
|
||||
event: {edit: backspaceword}
|
||||
}
|
||||
{
|
||||
name: cut_word_to_right
|
||||
modifier: alt
|
||||
keycode: char_d
|
||||
mode: emacs
|
||||
event: {edit: cutwordright}
|
||||
}
|
||||
{
|
||||
name: upper_case_word
|
||||
modifier: alt
|
||||
keycode: char_u
|
||||
mode: emacs
|
||||
event: {edit: uppercaseword}
|
||||
}
|
||||
{
|
||||
name: lower_case_word
|
||||
modifier: alt
|
||||
keycode: char_l
|
||||
mode: emacs
|
||||
event: {edit: lowercaseword}
|
||||
}
|
||||
{
|
||||
name: capitalize_char
|
||||
modifier: alt
|
||||
keycode: char_c
|
||||
mode: emacs
|
||||
event: {edit: capitalizechar}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
# The prompt indicators are environmental variables that represent
|
||||
# the state of the prompt
|
||||
$env.PROMPT_INDICATOR = ": "
|
||||
$env.PROMPT_INDICATOR_VI_INSERT = "⟩ "
|
||||
$env.PROMPT_INDICATOR_VI_NORMAL = "⟨ "
|
||||
$env.PROMPT_MULTILINE_INDICATOR = "::: "
|
||||
|
||||
use ~/.cache/starship/init.nu
|
||||
source ~/.local/share/atuin/init.nu
|
103
terminal/.config/nushell/env.nu
Normal file
103
terminal/.config/nushell/env.nu
Normal file
|
@ -0,0 +1,103 @@
|
|||
# Nushell Environment Config File
|
||||
#
|
||||
# version = "0.87.1"
|
||||
|
||||
# def create_left_prompt [] {
|
||||
# let home = $nu.home-path
|
||||
#
|
||||
# # Perform tilde substitution on dir
|
||||
# # To determine if the prefix of the path matches the home dir, we split the current path into
|
||||
# # segments, and compare those with the segments of the home dir. In cases where the current dir
|
||||
# # is a parent of the home dir (e.g. `/home`, homedir is `/home/user`), this comparison will
|
||||
# # also evaluate to true. Inside the condition, we attempt to str replace `$home` with `~`.
|
||||
# # Inside the condition, either:
|
||||
# # 1. The home prefix will be replaced
|
||||
# # 2. The current dir is a parent of the home dir, so it will be uneffected by the str replace
|
||||
# let dir = (
|
||||
# if ($env.PWD | path split | zip ($home | path split) | all { $in.0 == $in.1 }) {
|
||||
# ($env.PWD | str replace $home "~")
|
||||
# } else {
|
||||
# $env.PWD
|
||||
# }
|
||||
# )
|
||||
#
|
||||
# let path_color = (if (is-admin) { ansi red_bold } else { ansi green_bold })
|
||||
# let separator_color = (if (is-admin) { ansi light_red_bold } else { ansi light_green_bold })
|
||||
# let path_segment = $"($path_color)($dir)"
|
||||
#
|
||||
# $path_segment | str replace --all (char path_sep) $"($separator_color)(char path_sep)($path_color)"
|
||||
# }
|
||||
#
|
||||
# def create_right_prompt [] {
|
||||
# # create a right prompt in magenta with green separators and am/pm underlined
|
||||
# let time_segment = ([
|
||||
# (ansi reset)
|
||||
# (ansi magenta)
|
||||
# (date now | format date '%x %X %p') # try to respect user's locale
|
||||
# ] | str join | str replace --regex --all "([/:])" $"(ansi green)${1}(ansi magenta)" |
|
||||
# str replace --regex --all "([AP]M)" $"(ansi magenta_underline)${1}")
|
||||
#
|
||||
# let last_exit_code = if ($env.LAST_EXIT_CODE != 0) {([
|
||||
# (ansi rb)
|
||||
# ($env.LAST_EXIT_CODE)
|
||||
# ] | str join)
|
||||
# } else { "" }
|
||||
#
|
||||
# ([$last_exit_code, (char space), $time_segment] | str join)
|
||||
# }
|
||||
#
|
||||
# # Use nushell functions to define your right and left prompt
|
||||
# $env.PROMPT_COMMAND = {|| create_left_prompt }
|
||||
# # FIXME: This default is not implemented in rust code as of 2023-09-08.
|
||||
# $env.PROMPT_COMMAND_RIGHT = {|| create_right_prompt }
|
||||
|
||||
# The prompt indicators are environmental variables that represent
|
||||
# the state of the prompt
|
||||
$env.PROMPT_INDICATOR = {|| "> " }
|
||||
$env.PROMPT_INDICATOR_VI_INSERT = {|| ": " }
|
||||
$env.PROMPT_INDICATOR_VI_NORMAL = {|| "> " }
|
||||
$env.PROMPT_MULTILINE_INDICATOR = {|| "::: " }
|
||||
|
||||
# If you want previously entered commands to have a different prompt from the usual one,
|
||||
# you can uncomment one or more of the following lines.
|
||||
# This can be useful if you have a 2-line prompt and it's taking up a lot of space
|
||||
# because every command entered takes up 2 lines instead of 1. You can then uncomment
|
||||
# the line below so that previously entered commands show with a single `🚀`.
|
||||
# $env.TRANSIENT_PROMPT_COMMAND = {|| "🚀 " }
|
||||
# $env.TRANSIENT_PROMPT_INDICATOR = {|| "" }
|
||||
# $env.TRANSIENT_PROMPT_INDICATOR_VI_INSERT = {|| "" }
|
||||
# $env.TRANSIENT_PROMPT_INDICATOR_VI_NORMAL = {|| "" }
|
||||
# $env.TRANSIENT_PROMPT_MULTILINE_INDICATOR = {|| "" }
|
||||
# $env.TRANSIENT_PROMPT_COMMAND_RIGHT = {|| "" }
|
||||
|
||||
# Specifies how environment variables are:
|
||||
# - converted from a string to a value on Nushell startup (from_string)
|
||||
# - converted from a value back to a string when running external commands (to_string)
|
||||
# Note: The conversions happen *after* config.nu is loaded
|
||||
$env.ENV_CONVERSIONS = {
|
||||
"PATH": {
|
||||
from_string: { |s| $s | split row (char esep) | path expand --no-symlink }
|
||||
to_string: { |v| $v | path expand --no-symlink | str join (char esep) }
|
||||
}
|
||||
"Path": {
|
||||
from_string: { |s| $s | split row (char esep) | path expand --no-symlink }
|
||||
to_string: { |v| $v | path expand --no-symlink | str join (char esep) }
|
||||
}
|
||||
}
|
||||
|
||||
# Directories to search for scripts when calling source or use
|
||||
$env.NU_LIB_DIRS = [
|
||||
# FIXME: This default is not implemented in rust code as of 2023-09-06.
|
||||
($nu.default-config-dir | path join 'scripts') # add <nushell-config-dir>/scripts
|
||||
]
|
||||
|
||||
# Directories to search for plugin binaries when calling register
|
||||
$env.NU_PLUGIN_DIRS = [
|
||||
# FIXME: This default is not implemented in rust code as of 2023-09-06.
|
||||
($nu.default-config-dir | path join 'plugins') # add <nushell-config-dir>/plugins
|
||||
]
|
||||
|
||||
# To add entries to PATH (on Windows you might use Path), you can use the following pattern:
|
||||
# $env.PATH = ($env.PATH | split row (char esep) | prepend '/some/path')
|
||||
mkdir ~/.cache/starship
|
||||
starship init nu | save -f ~/.cache/starship/init.nu
|
|
@ -372,7 +372,7 @@ filextype <application/pdf>,*.pdf
|
|||
\ sioyek %c %i, zathura %c %i &, apvlv %c, xpdf %c,
|
||||
\ { edit text content }
|
||||
\ pdftotext -nopgbrk %c - | nvim
|
||||
filextype <application/pdf>,*.pdf
|
||||
fileviewer <application/pdf>,*.pdf
|
||||
\ pdftotext -nopgbrk %c -
|
||||
|
||||
" PostScript
|
||||
|
|
|
@ -5,7 +5,7 @@ CONFDIR="${XDG_CONFIG_HOME:-$HOME/.config}"
|
|||
ZSHCONFDIR="$CONFDIR/zsh"
|
||||
|
||||
# load completion, extended zsh moving syntax, zle edit in vim (or other $EDITOR) possibility
|
||||
autoload -Uz compinit zmv edit-command-line promptinit
|
||||
autoload -Uz compinit zmv edit-command-line
|
||||
|
||||
# Set completion style
|
||||
# The following lines were added by compinstall
|
||||
|
@ -60,17 +60,10 @@ zstyle ':fzf-tab:complete:kill:argument-rest' extra-opts --preview=$extract'ps -
|
|||
# give a preview of directory by exa when completing cd
|
||||
zstyle ':fzf-tab:complete:cd:*' extra-opts --preview=$extract'exa -1 --color=always $realpath'
|
||||
|
||||
# pure prompt init
|
||||
promptinit
|
||||
# make it single line
|
||||
prompt_newline='%666v'
|
||||
# show git stash status as a ≡
|
||||
zstyle :prompt:pure:git:stash show yes
|
||||
# show hostname if we are in a distrobox environment
|
||||
if [ -n "$DISTROBOX_ENTER_PATH" ] && [ -f /run/.containerenv ]; then
|
||||
local container=lxc
|
||||
fi
|
||||
prompt pure
|
||||
|
||||
# shellcheck source=alias
|
||||
[ -f "$CONFDIR/sh/alias" ] && source "$CONFDIR/sh/alias"
|
||||
|
@ -99,7 +92,9 @@ ENABLE_CORRECTION="true"
|
|||
# allow moving through directories without prepending cd
|
||||
setopt autocd
|
||||
|
||||
eval "$(starship init zsh)"
|
||||
eval "$(zoxide init zsh)"
|
||||
eval "$(atuin init zsh)"
|
||||
|
||||
# Speed up autocomplete, force prefix mapping
|
||||
zstyle ':completion:*' accept-exact '*(N)'
|
||||
|
@ -157,6 +152,26 @@ bindkey "^[." insert-last-word
|
|||
bindkey -v
|
||||
# remove the delay for switching modes
|
||||
export KEYTIMEOUT=1
|
||||
# Change cursor shape for different vi modes.
|
||||
function zle-keymap-select {
|
||||
if [[ ${KEYMAP} == vicmd ]] ||
|
||||
[[ $1 = 'block' ]]; then
|
||||
echo -ne '\e[2 q'
|
||||
|
||||
elif [[ ${KEYMAP} == main ]] ||
|
||||
[[ ${KEYMAP} == viins ]] ||
|
||||
[[ ${KEYMAP} = '' ]] ||
|
||||
[[ $1 = 'beam' ]]; then
|
||||
echo -ne '\e[6 q'
|
||||
fi
|
||||
}
|
||||
zle -N zle-keymap-select
|
||||
# Use beam shape cursor on startup.
|
||||
_fix_cursor() {
|
||||
echo -ne '\e[6 q'
|
||||
}
|
||||
precmd_functions+=(_fix_cursor)
|
||||
|
||||
# space puts a space, even in cmd mode
|
||||
bindkey -a ' ' magic-space
|
||||
# always allow backspace/delete to remove letters
|
||||
|
|
81
terminal/.local/share/atuin/init.nu
Normal file
81
terminal/.local/share/atuin/init.nu
Normal file
|
@ -0,0 +1,81 @@
|
|||
# Source this in your ~/.config/nushell/config.nu
|
||||
$env.ATUIN_SESSION = (atuin uuid)
|
||||
|
||||
# Magic token to make sure we don't record commands run by keybindings
|
||||
let ATUIN_KEYBINDING_TOKEN = $"# (random uuid)"
|
||||
|
||||
let _atuin_pre_execution = {||
|
||||
let cmd = (commandline)
|
||||
if ($cmd | is-empty) {
|
||||
return
|
||||
}
|
||||
if not ($cmd | str starts-with $ATUIN_KEYBINDING_TOKEN) {
|
||||
$env.ATUIN_HISTORY_ID = (atuin history start -- $cmd)
|
||||
}
|
||||
}
|
||||
|
||||
let _atuin_pre_prompt = {||
|
||||
let last_exit = $env.LAST_EXIT_CODE
|
||||
if 'ATUIN_HISTORY_ID' not-in $env {
|
||||
return
|
||||
}
|
||||
with-env { ATUIN_LOG: error } {
|
||||
do { atuin history end $'--exit=($last_exit)' -- $env.ATUIN_HISTORY_ID | null } | null
|
||||
|
||||
}
|
||||
hide-env ATUIN_HISTORY_ID
|
||||
}
|
||||
|
||||
def _atuin_search_cmd [...flags: string] {
|
||||
[
|
||||
$ATUIN_KEYBINDING_TOKEN,
|
||||
([
|
||||
`commandline (ATUIN_LOG=error run-external --redirect-stderr atuin search`,
|
||||
($flags | append [--interactive, --] | each {|e| $'"($e)"'}),
|
||||
`(commandline) | complete | $in.stderr | str substring ..-1)`,
|
||||
] | flatten | str join ' '),
|
||||
] | str join "\n"
|
||||
}
|
||||
|
||||
$env.config = ($env | default {} config).config
|
||||
$env.config = ($env.config | default {} hooks)
|
||||
$env.config = (
|
||||
$env.config | upsert hooks (
|
||||
$env.config.hooks
|
||||
| upsert pre_execution (
|
||||
$env.config.hooks | get -i pre_execution | default [] | append $_atuin_pre_execution)
|
||||
| upsert pre_prompt (
|
||||
$env.config.hooks | get -i pre_prompt | default [] | append $_atuin_pre_prompt)
|
||||
)
|
||||
)
|
||||
|
||||
$env.config = ($env.config | default [] keybindings)
|
||||
|
||||
$env.config = (
|
||||
$env.config | upsert keybindings (
|
||||
$env.config.keybindings
|
||||
| append {
|
||||
name: atuin
|
||||
modifier: control
|
||||
keycode: char_r
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: { send: executehostcommand cmd: (_atuin_search_cmd) }
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
# The up arrow keybinding has surprising behavior in Nu, and is disabled by default.
|
||||
# See https://github.com/atuinsh/atuin/issues/1025 for details
|
||||
# $env.config = (
|
||||
# $env.config | upsert keybindings (
|
||||
# $env.config.keybindings
|
||||
# | append {
|
||||
# name: atuin
|
||||
# modifier: none
|
||||
# keycode: up
|
||||
# mode: [emacs, vi_normal, vi_insert]
|
||||
# event: { send: executehostcommand cmd: (_atuin_search_cmd '--shell-up-key-binding') }
|
||||
# }
|
||||
# )
|
||||
# )
|
||||
|
Loading…
Reference in a new issue