Compare commits
10 Commits
5f18d5adc1
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
266ccc4140
|
|||
|
686887cdc0
|
|||
|
1567d85748
|
|||
|
3f586c4d0d
|
|||
|
bd739b0092
|
|||
|
e0eb3179fa
|
|||
|
d7721829b2
|
|||
|
21b90d8a22
|
|||
|
ebef24bec5
|
|||
|
a3698677ea
|
@@ -19,3 +19,9 @@
|
|||||||
[submodule "zsh/custom/plugins/zsh-vi-mode"]
|
[submodule "zsh/custom/plugins/zsh-vi-mode"]
|
||||||
path = zsh/custom/plugins/zsh-vi-mode
|
path = zsh/custom/plugins/zsh-vi-mode
|
||||||
url = https://github.com/jeffreytse/zsh-vi-mode
|
url = https://github.com/jeffreytse/zsh-vi-mode
|
||||||
|
[submodule "zsh/custom/plugins/evalcache"]
|
||||||
|
path = zsh/custom/plugins/evalcache
|
||||||
|
url = https://github.com/mroth/evalcache/
|
||||||
|
[submodule "zsh/custom/plugins/zsh-defer"]
|
||||||
|
path = zsh/custom/plugins/zsh-defer
|
||||||
|
url = https://github.com/romkatv/zsh-defer
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
disable-ccid
|
|
||||||
pcsc-shared
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
"actions-preview.nvim": { "branch": "master", "commit": "cb938c25edaac38d362555f19244a9cb85d561e8" },
|
"actions-preview.nvim": { "branch": "master", "commit": "2b604b2e8e662c03b716436f6ffebcb19663e66a" },
|
||||||
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
|
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
|
||||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||||
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
|
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
"lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" },
|
"lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "f5d2a8570f8b736ddb9bb4be504355bcd6e15ec8" },
|
"lualine.nvim": { "branch": "master", "commit": "f5d2a8570f8b736ddb9bb4be504355bcd6e15ec8" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "63a3c6a80538de1003373a619e29aeda27809ad3" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "0a3b42c3e503df87aef6d6513e13148381495c3a" },
|
||||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
|
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "b03fb0f20bc1d43daf558cda981a2be22e73ac42" },
|
"mason.nvim": { "branch": "main", "commit": "b03fb0f20bc1d43daf558cda981a2be22e73ac42" },
|
||||||
"multicolumn.nvim": { "branch": "master", "commit": "a363bdfd422abf26256f343dac4df183031f8e94" },
|
"multicolumn.nvim": { "branch": "master", "commit": "a363bdfd422abf26256f343dac4df183031f8e94" },
|
||||||
@@ -28,24 +28,24 @@
|
|||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "5cfe7fffbd01e17b3c1e14af85d5febdef88bd8c" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "5cfe7fffbd01e17b3c1e14af85d5febdef88bd8c" },
|
||||||
"nvim-dap": { "branch": "master", "commit": "b0f983507e3702f073bfe1516846e58b56d4e42f" },
|
"nvim-dap": { "branch": "master", "commit": "b0f983507e3702f073bfe1516846e58b56d4e42f" },
|
||||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "c588db330592fa477a70d2fee6ba20a57194bdc3" },
|
"nvim-lspconfig": { "branch": "master", "commit": "cb5bc0b2b35a6d513e3298d285db81453e791f4f" },
|
||||||
"nvim-surround": { "branch": "main", "commit": "9291040de8cd8a4439eb64c441e8d5d2bf884a5a" },
|
"nvim-surround": { "branch": "main", "commit": "9291040de8cd8a4439eb64c441e8d5d2bf884a5a" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" },
|
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" },
|
"nvim-treesitter-textobjects": { "branch": "main", "commit": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e" },
|
||||||
"nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" },
|
"nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" },
|
||||||
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
|
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||||
"ros-nvim": { "branch": "main", "commit": "1ad64cd3a1e144dfea67890845f9da2e82d96900" },
|
"ros-nvim": { "branch": "main", "commit": "1ad64cd3a1e144dfea67890845f9da2e82d96900" },
|
||||||
"schema-companion.nvim": { "branch": "main", "commit": "bcccfe46a1796f86b81dc3be6ab80ece3664d3b2" },
|
"schema-companion.nvim": { "branch": "main", "commit": "bcccfe46a1796f86b81dc3be6ab80ece3664d3b2" },
|
||||||
"schemastore.nvim": { "branch": "main", "commit": "35d19ffb25c9cf160f515360e9d8286cdd2c3d4f" },
|
"schemastore.nvim": { "branch": "main", "commit": "f5df9e70403b5d4c0642702a64534f04f3d71d03" },
|
||||||
"scrollEOF.nvim": { "branch": "master", "commit": "e462b9a07b8166c3e8011f1dcbc6bf68b67cd8d7" },
|
"scrollEOF.nvim": { "branch": "master", "commit": "e462b9a07b8166c3e8011f1dcbc6bf68b67cd8d7" },
|
||||||
"smart-open.nvim": { "branch": "0.3.x", "commit": "918c97cac0c33f7a116a822df144bc5bbefa4490" },
|
"smart-open.nvim": { "branch": "0.3.x", "commit": "918c97cac0c33f7a116a822df144bc5bbefa4490" },
|
||||||
"smart-splits.nvim": { "branch": "master", "commit": "0bd02161ee5c5378bf4133fcedf53d1fc4179e1d" },
|
"smart-splits.nvim": { "branch": "master", "commit": "09796a7ad0776c92518e0afae8688ef8d7f720e6" },
|
||||||
"snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" },
|
"snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" },
|
||||||
"sqlite.lua": { "branch": "master", "commit": "50092d60feb242602d7578398c6eb53b4a8ffe7b" },
|
"sqlite.lua": { "branch": "master", "commit": "50092d60feb242602d7578398c6eb53b4a8ffe7b" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "48d2656e54d3e3953ae647153ccdaffa50d4d76b" },
|
"telescope.nvim": { "branch": "master", "commit": "f7c673b8e46e8f233ff581d3624a517d33a7e264" },
|
||||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||||
"ultimate-autopair.nvim": { "branch": "v0.6", "commit": "6b58234de921437836efe27714b2026ed2ee235a" },
|
"ultimate-autopair.nvim": { "branch": "v0.6", "commit": "6b58234de921437836efe27714b2026ed2ee235a" },
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
-- https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
|
branch = "main",
|
||||||
|
opts = {
|
||||||
|
select = {
|
||||||
|
lookahead = true,
|
||||||
|
include_surrounding_whitespace = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
vim.keymap.set({ "x", "o" }, "aa", function()
|
||||||
|
require("nvim-treesitter-textobjects.select").select_textobject("@parameter.outer", "textobjects")
|
||||||
|
end)
|
||||||
|
vim.keymap.set({ "x", "o" }, "ia", function()
|
||||||
|
require("nvim-treesitter-textobjects.select").select_textobject("@parameter.inner", "textobjects")
|
||||||
|
end)
|
||||||
|
vim.keymap.set({ "x", "o" }, "af", function()
|
||||||
|
require("nvim-treesitter-textobjects.select").select_textobject("@function.outer", "textobjects")
|
||||||
|
end)
|
||||||
|
vim.keymap.set({ "x", "o" }, "if", function()
|
||||||
|
require("nvim-treesitter-textobjects.select").select_textobject("@function.inner", "textobjects")
|
||||||
|
end)
|
||||||
|
-- vim.keymap.set({ "x", "o" }, "ac", function()
|
||||||
|
-- require("nvim-treesitter-textobjects.select").select_textobject("@class.outer", "textobjects")
|
||||||
|
-- end)
|
||||||
|
-- vim.keymap.set({ "x", "o" }, "ic", function()
|
||||||
|
-- require("nvim-treesitter-textobjects.select").select_textobject("@class.inner", "textobjects")
|
||||||
|
-- end)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>a", function()
|
||||||
|
require("nvim-treesitter-textobjects.swap").swap_next("@parameter.inner")
|
||||||
|
end)
|
||||||
|
vim.keymap.set("n", "<leader>A", function()
|
||||||
|
require("nvim-treesitter-textobjects.swap").swap_previous("@parameter.inner")
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
-- https://github.com/windwp/nvim-ts-autotag
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"windwp/nvim-ts-autotag",
|
||||||
|
}
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
--- @module "lazy"
|
--- @module "lazy"
|
||||||
--- @type LazySpec
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
|
-- Issues with nvim 0.12
|
||||||
|
enabled = false,
|
||||||
"tadachs/ros-nvim",
|
"tadachs/ros-nvim",
|
||||||
event = { "BufRead", "BufNewFile" },
|
event = { "BufRead", "BufNewFile" },
|
||||||
opts = {
|
opts = {
|
||||||
|
|||||||
@@ -4,22 +4,13 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
dependencies = {
|
|
||||||
{ "nvim-treesitter/nvim-treesitter-textobjects", branch = "master" },
|
|
||||||
{ "windwp/nvim-ts-autotag", opts = {} },
|
|
||||||
},
|
|
||||||
lazy = false,
|
lazy = false,
|
||||||
branch = "master",
|
branch = "main",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
main = "nvim-treesitter.configs",
|
-- Taken from kickstart.nvim
|
||||||
init = function()
|
config = function()
|
||||||
vim.wo.foldmethod = "expr"
|
-- ensure basic parser are installed
|
||||||
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
local parsers = {
|
||||||
end,
|
|
||||||
--- @module "nvim-treesitter"
|
|
||||||
--- @type TSConfig
|
|
||||||
opts = {
|
|
||||||
ensure_installed = {
|
|
||||||
"c",
|
"c",
|
||||||
"cpp",
|
"cpp",
|
||||||
"go",
|
"go",
|
||||||
@@ -38,66 +29,57 @@ return {
|
|||||||
"cmake",
|
"cmake",
|
||||||
"json",
|
"json",
|
||||||
"yaml",
|
"yaml",
|
||||||
},
|
}
|
||||||
auto_install = true,
|
require("nvim-treesitter").install(parsers)
|
||||||
|
|
||||||
highlight = { enable = true },
|
---@param buf integer
|
||||||
indent = { enable = true },
|
---@param language string
|
||||||
incremental_selection = {
|
local function treesitter_try_attach(buf, language)
|
||||||
enable = true,
|
-- Check if the parser exists
|
||||||
keymaps = {
|
if not vim.treesitter.language.add(language) then
|
||||||
init_selection = "<M-o>",
|
return
|
||||||
node_incremental = "<M-o>",
|
end
|
||||||
node_decremental = "<M-i>",
|
vim.treesitter.start(buf, language)
|
||||||
},
|
|
||||||
},
|
-- TODO: Does this work properly?
|
||||||
textobjects = {
|
local has_fold_query = vim.treesitter.query.get(language, "folds") ~= nil
|
||||||
select = {
|
if has_fold_query then
|
||||||
enable = true,
|
vim.wo.foldmethod = "expr"
|
||||||
lookahead = true,
|
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||||
keymaps = {
|
end
|
||||||
["aa"] = "@parameter.outer",
|
|
||||||
["ia"] = "@parameter.inner",
|
local has_indent_query = vim.treesitter.query.get(language, "indents") ~= nil
|
||||||
["af"] = "@function.outer",
|
if has_indent_query then
|
||||||
["if"] = "@function.inner",
|
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||||
-- ["ac"] = "@class.outer",
|
end
|
||||||
-- ["ic"] = "@class.inner",
|
end
|
||||||
},
|
|
||||||
},
|
local available_parsers = require("nvim-treesitter").get_available()
|
||||||
move = {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
enable = true,
|
callback = function(args)
|
||||||
set_jumps = true,
|
local buf, filetype = args.buf, args.match
|
||||||
goto_next_start = {
|
|
||||||
["]a"] = "@parameter.inner",
|
local language = vim.treesitter.language.get_lang(filetype)
|
||||||
["]f"] = "@function.outer",
|
if not language then
|
||||||
["]c"] = "@class.outer",
|
return
|
||||||
},
|
end
|
||||||
goto_next_end = {
|
|
||||||
["]A"] = "@parameter.inner",
|
local installed_parsers = require("nvim-treesitter").get_installed("parsers")
|
||||||
["]F"] = "@function.outer",
|
|
||||||
["]c"] = "@class.outer",
|
if vim.tbl_contains(installed_parsers, language) then
|
||||||
},
|
-- enable the parser if it is installed
|
||||||
goto_previous_start = {
|
treesitter_try_attach(buf, language)
|
||||||
["[a"] = "@parameter.inner",
|
elseif vim.tbl_contains(available_parsers, language) then
|
||||||
["[f"] = "@function.outer",
|
-- if a parser is available in `nvim-treesitter` auto install it, and enable it after the installation is done
|
||||||
["[c"] = "@class.outer",
|
require("nvim-treesitter").install(language):await(function()
|
||||||
},
|
treesitter_try_attach(buf, language)
|
||||||
goto_previous_end = {
|
end)
|
||||||
["[A"] = "@parameter.inner",
|
else
|
||||||
["[F"] = "@function.outer",
|
-- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter`
|
||||||
["[c"] = "@class.outer",
|
treesitter_try_attach(buf, language)
|
||||||
},
|
end
|
||||||
},
|
end,
|
||||||
swap = {
|
})
|
||||||
enable = true,
|
end,
|
||||||
swap_next = {
|
|
||||||
["<leader>a"] = "@parameter.inner",
|
|
||||||
},
|
|
||||||
swap_previous = {
|
|
||||||
["<leader>A"] = "@parameter.inner",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule
+1
Submodule zsh/custom/plugins/evalcache added at d6973f8c3e
@@ -0,0 +1,32 @@
|
|||||||
|
# mise
|
||||||
|
|
||||||
|
Adds integration with [mise](https://github.com/jdx/mise) (formerly `rtx`), a runtime executor compatible with
|
||||||
|
npm, nodenv, pyenv, etc. mise is written in rust and is very fast. 20x-200x faster than asdf. With that being
|
||||||
|
said, mise is compatible with asdf plugins and .tool-versions files. It can be used as a drop-in replacement.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. [Download & install mise](https://github.com/jdx/mise#installation) by running the following:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl https://mise.jdx.dev/install.sh | sh
|
||||||
|
```
|
||||||
|
|
||||||
|
2. [Enable mise](https://github.com/jdx/mise#quickstart) by adding it to your `plugins` definition in
|
||||||
|
`~/.zshrc`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
plugins=(mise)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
See the [mise readme](https://github.com/jdx/mise#table-of-contents) for information on how to use mise. Here
|
||||||
|
are a few examples:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mise install node Install the current version specified in .tool-versions/.mise.toml
|
||||||
|
mise use -g node@system Use system node as global default
|
||||||
|
mise install node@20.0.0 Install a specific version number
|
||||||
|
mise use -g node@20 Use node-20.x as global default
|
||||||
|
```
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
if (( ! $+commands[mise] )); then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Load mise hooks
|
||||||
|
zsh-defer -a _evalcache mise activate zsh
|
||||||
|
|
||||||
|
# If the completion file doesn't exist yet, we need to autoload it and
|
||||||
|
# bind it to `mise`. Otherwise, compinit will have already done that.
|
||||||
|
if [[ ! -f "$ZSH_CACHE_DIR/completions/_mise" ]]; then
|
||||||
|
typeset -g -A _comps
|
||||||
|
autoload -Uz _mise
|
||||||
|
_comps[mise]=_mise
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Generate and load mise completion
|
||||||
|
mise completion zsh >| "$ZSH_CACHE_DIR/completions/_mise" &|
|
||||||
Submodule zsh/custom/plugins/zsh-completions updated: b48b5de9d8...47e40c923c
Submodule
+1
Submodule zsh/custom/plugins/zsh-defer added at 53a26e287f
@@ -156,72 +156,32 @@ prompt_git() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt_bzr() {
|
git_toplevel() {
|
||||||
(( $+commands[bzr] )) || return
|
local repo_root=$(git rev-parse --show-toplevel)
|
||||||
|
if [[ $repo_root = '' ]]; then
|
||||||
# Test if bzr repository in directory hierarchy
|
# We are in a bare repo. Use git dir as root
|
||||||
local dir="$PWD"
|
repo_root=$(git rev-parse --git-dir)
|
||||||
while [[ ! -d "$dir/.bzr" ]]; do
|
if [[ $repo_root = '.' ]]; then
|
||||||
[[ "$dir" = "/" ]] && return
|
repo_root=$PWD
|
||||||
dir="${dir:h}"
|
|
||||||
done
|
|
||||||
|
|
||||||
local bzr_status status_mod status_all revision
|
|
||||||
if bzr_status=$(bzr status 2>&1); then
|
|
||||||
status_mod=$(echo -n "$bzr_status" | head -n1 | grep "modified" | wc -m)
|
|
||||||
status_all=$(echo -n "$bzr_status" | head -n1 | wc -m)
|
|
||||||
revision=${$(bzr log -r-1 --log-format line | cut -d: -f1):gs/%/%%}
|
|
||||||
if [[ $status_mod -gt 0 ]] ; then
|
|
||||||
prompt_segment yellow black "bzr@$revision ✚"
|
|
||||||
else
|
|
||||||
if [[ $status_all -gt 0 ]] ; then
|
|
||||||
prompt_segment yellow black "bzr@$revision"
|
|
||||||
else
|
|
||||||
prompt_segment 10 black "bzr@$revision"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
prompt_hg() {
|
|
||||||
(( $+commands[hg] )) || return
|
|
||||||
local rev st branch
|
|
||||||
if $(hg id >/dev/null 2>&1); then
|
|
||||||
if $(hg prompt >/dev/null 2>&1); then
|
|
||||||
if [[ $(hg prompt "{status|unknown}") = "?" ]]; then
|
|
||||||
# if files are not added
|
|
||||||
prompt_segment red white
|
|
||||||
st='±'
|
|
||||||
elif [[ -n $(hg prompt "{status|modified}") ]]; then
|
|
||||||
# if any modification
|
|
||||||
prompt_segment yellow black
|
|
||||||
st='±'
|
|
||||||
else
|
|
||||||
# if working copy is clean
|
|
||||||
prompt_segment 10 $CURRENT_FG
|
|
||||||
fi
|
|
||||||
echo -n ${$(hg prompt "☿ {rev}@{branch}"):gs/%/%%} $st
|
|
||||||
else
|
|
||||||
st=""
|
|
||||||
rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g')
|
|
||||||
branch=$(hg id -b 2>/dev/null)
|
|
||||||
if `hg st | grep -q "^\?"`; then
|
|
||||||
prompt_segment red black
|
|
||||||
st='±'
|
|
||||||
elif `hg st | grep -q "^[MA]"`; then
|
|
||||||
prompt_segment yellow black
|
|
||||||
st='±'
|
|
||||||
else
|
|
||||||
prompt_segment 10 $CURRENT_FG
|
|
||||||
fi
|
|
||||||
echo -n "☿ ${rev:gs/%/%%}@${branch:gs/%/%%}" $st
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
echo -n $repo_root
|
||||||
}
|
}
|
||||||
|
|
||||||
# Dir: current working directory
|
# Dir: current working directory
|
||||||
prompt_dir() {
|
prompt_dir() {
|
||||||
|
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
|
||||||
|
# Git repo and inline path enabled, hence only show the git root
|
||||||
|
local repo_root=$(git_toplevel)
|
||||||
|
local path_in_repo=$(pwd | sed "s/^$(echo "$repo_root" | sed 's:/:\\/:g;s/\$/\\$/g')//;s:^/::;s:/$::;")
|
||||||
|
if [[ -z "$path_in_repo" ]]; then
|
||||||
|
prompt_segment 12 $CURRENT_FG "$(git_toplevel | sed "s:^$HOME:~:")"
|
||||||
|
else
|
||||||
|
prompt_segment 12 $CURRENT_FG "$(git_toplevel | sed "s:^$HOME:~:")/%B$path_in_repo%b"
|
||||||
|
fi
|
||||||
|
else
|
||||||
prompt_segment 12 $CURRENT_FG '%~'
|
prompt_segment 12 $CURRENT_FG '%~'
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Virtualenv: current working virtualenv
|
# Virtualenv: current working virtualenv
|
||||||
@@ -232,27 +192,6 @@ prompt_virtualenv() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# nix-shell: currently running nix-shell
|
|
||||||
prompt_nix_shell() {
|
|
||||||
if [[ -n "$IN_NIX_SHELL" ]]; then
|
|
||||||
if [[ -n $NIX_SHELL_PACKAGES ]]; then
|
|
||||||
local package_names=""
|
|
||||||
local packages=($NIX_SHELL_PACKAGES)
|
|
||||||
for package in $packages; do
|
|
||||||
package_names+=" ${package##*.}"
|
|
||||||
done
|
|
||||||
prompt_segment magenta black "$package_names"
|
|
||||||
elif [[ -n $name ]]; then
|
|
||||||
local cleanName=${name#interactive-}
|
|
||||||
cleanName=${cleanName#lorri-keep-env-hack-}
|
|
||||||
cleanName=${cleanName%-environment}
|
|
||||||
prompt_segment magenta black "$cleanName"
|
|
||||||
else # This case is only reached if the nix-shell plugin isn't installed or failed in some way
|
|
||||||
prompt_segment magenta black "nix-shell"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Status:
|
# Status:
|
||||||
# - was there an error
|
# - was there an error
|
||||||
# - am I root
|
# - am I root
|
||||||
@@ -264,31 +203,14 @@ prompt_status() {
|
|||||||
[[ $UID -eq 0 ]] && prompt_segment 11 black ""
|
[[ $UID -eq 0 ]] && prompt_segment 11 black ""
|
||||||
}
|
}
|
||||||
|
|
||||||
#AWS Profile:
|
|
||||||
# - display current AWS_PROFILE name
|
|
||||||
# - displays yellow on red if profile name contains 'production' or
|
|
||||||
# ends in '-prod'
|
|
||||||
# - displays black on green otherwise
|
|
||||||
prompt_aws() {
|
|
||||||
[[ -z "$AWS_PROFILE" || "$SHOW_AWS_PROMPT" = false ]] && return
|
|
||||||
case "$AWS_PROFILE" in
|
|
||||||
*-prod|*production*) prompt_segment red 11 "AWS: ${AWS_PROFILE:gs/%/%%}" ;;
|
|
||||||
*) prompt_segment cyan black "AWS: ${AWS_PROFILE:gs/%/%%}" ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
## Main prompt
|
## Main prompt
|
||||||
build_prompt() {
|
build_prompt() {
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
prompt_status
|
prompt_status
|
||||||
prompt_context
|
prompt_context
|
||||||
prompt_virtualenv
|
prompt_virtualenv
|
||||||
prompt_nix_shell
|
|
||||||
prompt_aws
|
|
||||||
prompt_dir
|
prompt_dir
|
||||||
prompt_git
|
prompt_git
|
||||||
prompt_bzr
|
|
||||||
prompt_hg
|
|
||||||
prompt_end
|
prompt_end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+19
-5
@@ -1,3 +1,4 @@
|
|||||||
|
# vim: set ft=zsh:
|
||||||
# Path to your oh-my-zsh installation.
|
# Path to your oh-my-zsh installation.
|
||||||
export DOTFILES=${DOTFILES:-"$HOME/.dotfiles"}
|
export DOTFILES=${DOTFILES:-"$HOME/.dotfiles"}
|
||||||
export ZSH="$DOTFILES/zsh/ohmyzsh"
|
export ZSH="$DOTFILES/zsh/ohmyzsh"
|
||||||
@@ -5,8 +6,18 @@ export ZSH_CUSTOM="$DOTFILES/zsh/custom"
|
|||||||
|
|
||||||
ZSH_THEME="agnoster_dx"
|
ZSH_THEME="agnoster_dx"
|
||||||
|
|
||||||
zstyle ':omz:update' mode reminder # just remind me to update when it's time
|
zstyle -s ':omz:update' mode "disabled"
|
||||||
# zstyle ':omz:update' frequency 13
|
|
||||||
|
# Fix slow pasting due to zsh-autosuggestions
|
||||||
|
pasteinit() {
|
||||||
|
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
|
||||||
|
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
|
||||||
|
}
|
||||||
|
pastefinish() {
|
||||||
|
zle -N self-insert $OLD_SELF_INSERT
|
||||||
|
}
|
||||||
|
zstyle :bracketed-paste-magic paste-init pasteinit
|
||||||
|
zstyle :bracketed-paste-magic paste-finish pastefinish
|
||||||
|
|
||||||
# CASE_SENSITIVE="true"
|
# CASE_SENSITIVE="true"
|
||||||
# HYPHEN_INSENSITIVE="true"
|
# HYPHEN_INSENSITIVE="true"
|
||||||
@@ -18,6 +29,8 @@ ZSH_DISABLE_COMPFIX="true"
|
|||||||
ZOXIDE_CMD_OVERRIDE="cd"
|
ZOXIDE_CMD_OVERRIDE="cd"
|
||||||
|
|
||||||
plugins=(
|
plugins=(
|
||||||
|
evalcache
|
||||||
|
zsh-defer
|
||||||
git
|
git
|
||||||
zsh-autosuggestions
|
zsh-autosuggestions
|
||||||
# Disabled because the highlighting conflicts with autosuggestions
|
# Disabled because the highlighting conflicts with autosuggestions
|
||||||
@@ -30,6 +43,7 @@ plugins=(
|
|||||||
zoxide
|
zoxide
|
||||||
mise
|
mise
|
||||||
gpg-agent
|
gpg-agent
|
||||||
|
vagrant
|
||||||
)
|
)
|
||||||
|
|
||||||
bindkey -M vicmd "k" up-line-or-beginning-search
|
bindkey -M vicmd "k" up-line-or-beginning-search
|
||||||
@@ -63,7 +77,6 @@ KEYTIMEOUT=1
|
|||||||
|
|
||||||
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/completions
|
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/completions
|
||||||
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
|
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
|
||||||
autoload -Uz compinit && compinit
|
|
||||||
source "$ZSH/oh-my-zsh.sh"
|
source "$ZSH/oh-my-zsh.sh"
|
||||||
|
|
||||||
less_termcap[so]="${fg_bold[black]}${bg[white]}"
|
less_termcap[so]="${fg_bold[black]}${bg[white]}"
|
||||||
@@ -117,7 +130,8 @@ else
|
|||||||
unset PNPM_HOME
|
unset PNPM_HOME
|
||||||
fi
|
fi
|
||||||
if (( $+commands[pnpm] )); then
|
if (( $+commands[pnpm] )); then
|
||||||
source <(pnpm completion zsh)
|
# Without evalcache it more than doubles startup time
|
||||||
|
_evalcache pnpm completion zsh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export FZF_DEFAULT_OPTS='--tmux'
|
export FZF_DEFAULT_OPTS='--tmux'
|
||||||
@@ -138,7 +152,7 @@ fi
|
|||||||
|
|
||||||
if (( $+commands[fzf] )); then
|
if (( $+commands[fzf] )); then
|
||||||
# Fix fzf keybind after zsh-vi-mode has loaded
|
# Fix fzf keybind after zsh-vi-mode has loaded
|
||||||
zvm_after_init_commands+=('source <(fzf --zsh)')
|
zvm_after_init_commands+=('_evalcache fzf --zsh')
|
||||||
|
|
||||||
if (( $+commands[paru] )); then
|
if (( $+commands[paru] )); then
|
||||||
function pi {
|
function pi {
|
||||||
|
|||||||
+1
-1
Submodule zsh/ohmyzsh updated: 8df5c1b18b...349b9e49ce
Reference in New Issue
Block a user