add nvim plugins
Added: - flash.nvim for better movement - debugprint.nvim for insert print debug statements
This commit is contained in:
parent
d082d41624
commit
d870d23e79
7 changed files with 72 additions and 31 deletions
|
|
@ -11,7 +11,7 @@ local function default(desc)
|
|||
}
|
||||
end
|
||||
|
||||
local function fixIdentation()
|
||||
local function fixIndentation()
|
||||
local indent = 2
|
||||
vim.opt.tabstop = indent
|
||||
vim.opt.shiftwidth = indent
|
||||
|
|
@ -24,7 +24,7 @@ end
|
|||
-- See `:help vim.keymap.set()`
|
||||
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
|
||||
|
||||
vim.keymap.set("n", "<C-s>", "<CMD>w<CR>", default("Keep cursor centered while junping"))
|
||||
-- vim.keymap.set("n", "<C-s>", "<CMD>w<CR>", default("Keep cursor centered while junping"))
|
||||
|
||||
-- Remap for dealing with word wrap
|
||||
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
|
|
@ -50,14 +50,14 @@ vim.keymap.set(
|
|||
default("Search and replace current word")
|
||||
)
|
||||
|
||||
vim.keymap.set("n", "<leader>rR", ":s/", default("Search and replace inline"))
|
||||
vim.keymap.set("n", "<leader>rr", ":%s/", default("Search and replace globally"))
|
||||
vim.keymap.set("v", "<leader>r", ":s/", default("Search and replace in selection"))
|
||||
-- vim.keymap.set("n", "<leader>rR", ":s/", default("Search and replace inline"))
|
||||
-- vim.keymap.set("n", "<leader>rr", ":%s/", default("Search and replace globally"))
|
||||
-- vim.keymap.set("v", "<leader>r", ":s/", default("Search and replace in selection"))
|
||||
|
||||
vim.keymap.set("v", "p", [["_dP]], default("Paste whitout lossing yanked text"))
|
||||
vim.keymap.set("v", "p", [["_dP]], default("Paste without lossing yanked text"))
|
||||
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", default("Move selection down"))
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", default("Move selection up"))
|
||||
vim.keymap.set("n", "<Leader>uI", fixIdentation, default("Fix identation"))
|
||||
vim.keymap.set("n", "<Leader>uI", fixIndentation, default("Fix indentation"))
|
||||
|
||||
vim.keymap.set("n", "<Leader>uh", ":nohl<CR>", default("Remove search highlight"))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
"andrewferrier/debugprint.nvim",
|
||||
opts = {},
|
||||
-- Remove the following line to use development versions,
|
||||
-- not just the formal releases
|
||||
version = "*",
|
||||
}
|
||||
25
chezmoi/dot_config/nvim/lua/aleidk/plugins/flash.lua
Normal file
25
chezmoi/dot_config/nvim/lua/aleidk/plugins/flash.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
return {
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
---@type Flash.Config
|
||||
opts = {
|
||||
label = {
|
||||
rainbow = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
modes = {
|
||||
search = {
|
||||
enabled = false, -- actibable with require("flash").toggle(),
|
||||
},
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||
},
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
return {
|
||||
"echasnovski/mini.surround",
|
||||
disabled = true,
|
||||
version = "*",
|
||||
opts = {},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,10 @@
|
|||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"comment-box.nvim": { "branch": "main", "commit": "dd1a48f8d06102e9b87ae1e0069bc365c006979b" },
|
||||
"conform.nvim": { "branch": "master", "commit": "e4ecb6e8ed3163c86d7e647f1dc3d94de77ca687" },
|
||||
"debugprint.nvim": { "branch": "main", "commit": "159c7522438c6cf53540fb588fcf5bdad692d1bc" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "d38c1b5266850f77f75e006bcc26213684e1e141" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" },
|
||||
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "5a9a6ac29a7805c4783cda21b80a1e361964b3f2" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "046e2cf04e08ece927bacbfb87c5b35c0b636546" },
|
||||
|
|
|
|||
|
|
@ -1,55 +1,55 @@
|
|||
# SSH tunnel
|
||||
ssh-tunnel() {
|
||||
|
||||
local_port=$1 && shift
|
||||
remote_port=$1 && shift
|
||||
server=$1 && shift
|
||||
local_port=$1 && shift
|
||||
remote_port=$1 && shift
|
||||
server=$1 && shift
|
||||
|
||||
echo "Starting SSH Tunnel for $server"
|
||||
echo "Starting SSH Tunnel for $server"
|
||||
|
||||
ssh -N -L "$local_port":localhost:"$remote_port" "$server"
|
||||
ssh -N -L "$local_port":localhost:"$remote_port" "$server"
|
||||
}
|
||||
|
||||
# quick wordpress in docker
|
||||
dwps() {
|
||||
image_name="wordpress-development"
|
||||
container_build_path="$HOME/Repos/Private/docker-services/wordpress"
|
||||
original_path="$PWD"
|
||||
image_name="wordpress-development"
|
||||
container_build_path="$HOME/Repos/Private/docker-services/wordpress"
|
||||
original_path="$PWD"
|
||||
|
||||
if [[ "$(docker images -q $image_name 2> /dev/null)" == "" ]] ; then
|
||||
cd "$container_build_path"
|
||||
docker build --tag "$image_name" .
|
||||
cd "$original_path"
|
||||
fi
|
||||
if [[ "$(docker images -q $image_name 2>/dev/null)" == "" ]]; then
|
||||
cd "$container_build_path"
|
||||
docker build --tag "$image_name" .
|
||||
cd "$original_path"
|
||||
fi
|
||||
|
||||
docker run -d --rm -p 3000:80 --user 1000:1000 -v "$PWD":/var/www/html --name "$image_name" "$image_name"
|
||||
docker run -d --rm -p 3000:80 --user 1000:1000 -v "$PWD":/var/www/html --name "$image_name" "$image_name"
|
||||
}
|
||||
|
||||
## Create python venv
|
||||
pvenv() {
|
||||
[[ -n $VIRTAUL_ENV ]] && echo "Virtual enviroment already sourced" && return
|
||||
[[ -n $VIRTAUL_ENV ]] && echo "Virtual enviroment already sourced" && return
|
||||
|
||||
dir=${1:-venv}
|
||||
dir=${1:-venv}
|
||||
|
||||
[[ ! -d $dir ]] && echo "Creating virtual enviroment..." && python -m venv $dir
|
||||
[[ ! -d $dir ]] && echo "Creating virtual enviroment..." && python -m venv $dir
|
||||
|
||||
source "$dir/bin/activate"
|
||||
source "$dir/bin/activate"
|
||||
}
|
||||
|
||||
# Print bottlenecks
|
||||
profzsh() {
|
||||
shell=${1-$SHELL}
|
||||
ZPROF=true $shell -i -c exit
|
||||
shell=${1-$SHELL}
|
||||
ZPROF=true $shell -i -c exit
|
||||
}
|
||||
|
||||
# Pretty Help
|
||||
alias bathelp='bat --plain --language=help'
|
||||
help() {
|
||||
"$@" --help 2>&1 | bathelp
|
||||
"$@" --help 2>&1 | bathelp
|
||||
}
|
||||
|
||||
fzf-jq() {
|
||||
echo '' | fzf --print-query --preview="jq -r {q} <$@"
|
||||
echo '' | fzf --print-query --preview="jq -r {q} <$@"
|
||||
}
|
||||
|
||||
function ya() {
|
||||
|
|
@ -60,3 +60,9 @@ function ya() {
|
|||
fi
|
||||
rm -f -- "$tmp"
|
||||
}
|
||||
|
||||
# Zellij
|
||||
function zr() { zellij run --name "$*" -- zsh -ic "$*"; }
|
||||
function zrf() { zellij run --name "$*" --floating -- zsh -ic "$*"; }
|
||||
function ze() { zellij edit "$*"; }
|
||||
function zef() { zellij edit --floating "$*"; }
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ setopt GLOB_COMPLETE # Show autocompletion menu with globs
|
|||
setopt MENU_COMPLETE # Automatically highlight first element of completion menu
|
||||
|
||||
# fpath+=${ZSH_CUSTOM:-${ZSH:-$XDG_DATA_HOME/oh-my-zsh}/custom}/plugins/zsh-completions/src
|
||||
fpath+=${XDG_CONFIG_HOME:-$DOTS/config}/zsh/completions
|
||||
fpath+=${XDG_CONFIG_HOME:-$HOME/.config}/zsh/completions
|
||||
autoload -Uz ${XDG_CONFIG_HOME:-$HOME/.config}/zsh/completions/*
|
||||
|
||||
zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
|
||||
zstyle ':completion:*:warnings' format '%F{cyan}%BSorry, no matches for: %d%b%f'
|
||||
|
|
@ -108,7 +109,6 @@ if [[ "$ZPROF" = true ]]; then
|
|||
fi
|
||||
|
||||
eval "$(starship init zsh)"
|
||||
# eval "$(zellij setup --generate-auto-start zsh)"
|
||||
eval "$(zoxide init zsh)"
|
||||
eval "$(mise activate zsh)"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue