updates to dotfile
This commit is contained in:
parent
b89a895f43
commit
a8735ea716
9 changed files with 369 additions and 200 deletions
1
.config/bash/.bash_aliases
Normal file
1
.config/bash/.bash_aliases
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
alias gs="git status"
|
||||||
155
.config/bash/.bash_profile
Normal file
155
.config/bash/.bash_profile
Normal file
|
|
@ -0,0 +1,155 @@
|
||||||
|
# list directory and cd into it
|
||||||
|
sd() {
|
||||||
|
local path=${1:-.}
|
||||||
|
local result=$(ls -d ${path}/*/ 2> /dev/null | fzf)
|
||||||
|
if [[ -n "${result}" ]]; then
|
||||||
|
cd "${result}"
|
||||||
|
else
|
||||||
|
echo "No directories found or no selection made."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# list files and opens it in neovim
|
||||||
|
sf() {
|
||||||
|
local path=${2:-.}
|
||||||
|
if [[ $1 == "-h" ]]; then
|
||||||
|
local result=$(find ${path} -type f -name '.*' 2> /dev/null | fzf)
|
||||||
|
else
|
||||||
|
local result=$(find ${path} -type f 2> /dev/null | fzf)
|
||||||
|
fi
|
||||||
|
if [[ -n "${result}" ]]; then
|
||||||
|
nvim "${result}"
|
||||||
|
else
|
||||||
|
echo "No files found or no selecteion made."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# fuzzy cd into specific folders
|
||||||
|
fcd() {
|
||||||
|
local selected_dir=$({
|
||||||
|
echo "$HOME/.config"
|
||||||
|
find "$HOME/ghq" -mindepth 2 -maxdepth 2 -type d
|
||||||
|
ls -d -1 "$HOME/"/*/ | grep -v \.git
|
||||||
|
ls -d -1 */ | perl -pe "s#^#$PWD/#" | grep -v \.git
|
||||||
|
} | fzf)
|
||||||
|
|
||||||
|
if [ -n "$selected_dir" ]; then
|
||||||
|
cd "$selected_dir"
|
||||||
|
if [[ -f .nvmrc ]]; then
|
||||||
|
NVMRC_VERSION=$(cat .nvmrc)
|
||||||
|
CURRENT_VERSION=$(nvm current)
|
||||||
|
if [ "$NVMRC_VERSIOn" != "$CURRENT_VERSION" ]; then
|
||||||
|
nvm use
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No selection made."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# clone repository
|
||||||
|
gc() {
|
||||||
|
local url=$1
|
||||||
|
local ghq_dir="$HOME/ghq"
|
||||||
|
|
||||||
|
# extract project name
|
||||||
|
if [[ $url =~ git@github\.com:([^/]+)/([^/]+)\.git ]]; then
|
||||||
|
local project_name="${BASH_REMATCH[1]}"
|
||||||
|
local repository_name="${BASH_REMATCH[2]}"
|
||||||
|
elif [[ $url =~ https://github\.com/([^/]+)/([^/]+)\.git ]]; then
|
||||||
|
local project_name="${BASH_REMATCH[1]}"
|
||||||
|
local repository_name="${BASH_REMATCH[2]}"
|
||||||
|
else
|
||||||
|
echo "Invalid URL format"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check if directory for project exists or not
|
||||||
|
local project_dir="${ghq_dir}/${project_name}/${repository_name}"
|
||||||
|
if [[ ! -d $project_dir ]]; then
|
||||||
|
mkdir -p $project_dir
|
||||||
|
fi
|
||||||
|
|
||||||
|
git clone $url $project_dir
|
||||||
|
}
|
||||||
|
|
||||||
|
# get branch if available
|
||||||
|
parse_git_branch() {
|
||||||
|
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set prompt
|
||||||
|
color_prompt=yes
|
||||||
|
|
||||||
|
if [ "$color_prompt" = yes ]; then
|
||||||
|
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]\$(parse_git_branch)\[\033[00m\] \$ "
|
||||||
|
else
|
||||||
|
PS1="${debian_chroot:+($debian_chroot)}\u@\h:\w\$(parse_git_branch)\$ "
|
||||||
|
fi
|
||||||
|
unset color_prompt
|
||||||
|
|
||||||
|
# install curl to complete auto installs
|
||||||
|
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
|
||||||
|
|
||||||
|
# auto install nvm
|
||||||
|
command -v nvm > /dev/null 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "NVM is not installed. Installing now..."
|
||||||
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
|
||||||
|
echo "NVM is now installed. Installing node..."
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||||
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||||
|
nvm install lts && nvm use lts
|
||||||
|
echo "Node is now installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# auto install pnpm
|
||||||
|
command -v pnpm > /dev/null 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "PNPM is not installed. Installing now..."
|
||||||
|
export SHELL=/bin/bash
|
||||||
|
curl -fsSL https://get.pnpm.io/install.sh | sh -
|
||||||
|
# pnpm
|
||||||
|
export PNPM_HOME="/root/.local/share/pnpm"
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$PNPM_HOME:"*) ;;
|
||||||
|
*) export PATH="$PNPM_HOME:$PATH" ;;
|
||||||
|
esac
|
||||||
|
# pnpm end
|
||||||
|
echo "PNPM is now installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# auto install gh cli
|
||||||
|
command -v gh > /dev/null 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "GitHub CLI is not installed. Installing now..."
|
||||||
|
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
|
||||||
|
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
|
||||||
|
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
||||||
|
&& sudo apt update \
|
||||||
|
&& sudo apt install gh -y
|
||||||
|
|
||||||
|
echo "GitHub CLI is now installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# auto install neovim
|
||||||
|
command -v nvim > /dev/null 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "NeoVim is not installed. Installing now..."
|
||||||
|
mkdir -p ~/opt
|
||||||
|
curl -L https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz -o ~/opt/nvim-linux64.tar.gz
|
||||||
|
tar xzf ~/opt/nvim-linux64.tar.gz -C ~/opt
|
||||||
|
|
||||||
|
# create symlink
|
||||||
|
ln -s ~/opt/nvim-linux64/bin/nvim /usr/local/bin/nvim
|
||||||
|
# create symlink as vim if vim is not installed
|
||||||
|
type -p vim >/dev/null || ln -s ~/opt/nvim-linux64/bin/nvim /usr/local/bin/vim
|
||||||
|
|
||||||
|
# remove tar file
|
||||||
|
rm ~/opt/nvim-linux64.tar.gz
|
||||||
|
|
||||||
|
echo "NeoVim is now installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PATH=$PATH:/usr/local/go/bin:/home/jc/go/bin
|
||||||
|
|
@ -1,39 +1,39 @@
|
||||||
{
|
{
|
||||||
"Comment.nvim": { "branch": "master", "commit": "176e85eeb63f1a5970d6b88f1725039d85ca0055" },
|
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||||
"LuaSnip": { "branch": "master", "commit": "a658ae2906344a1d2b9c507738e585cf68e685c7" },
|
"LuaSnip": { "branch": "master", "commit": "c4d6298347f7707e9757351b2ee03d0c00da5c20" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
||||||
"fzf": { "branch": "master", "commit": "547e101f1d6bf326d286bac0fb3272738a92a67f" },
|
"fzf": { "branch": "master", "commit": "178581b56001f7553fe83b15dab820179521a915" },
|
||||||
"fzf-lua": { "branch": "main", "commit": "19732fdf9b8b038b6a5813b077b382ab2b48e094" },
|
"fzf-lua": { "branch": "main", "commit": "b7bda51ba7d0c07aaa30e8428a6531e939f6c3a3" },
|
||||||
"git.nvim": { "branch": "main", "commit": "7a342e61f28e321ef08e00fca4be74ff3ef88335" },
|
"git.nvim": { "branch": "main", "commit": "eb09b8d01d7bb38ca1d65ed0d82d71bddcd8a8bd" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "dc2962f7fce953a2a98e7c6d3d7fc4c1d1f66758" },
|
"gitsigns.nvim": { "branch": "main", "commit": "79127db3b127f5d125f35e0d44ba60715edf2842" },
|
||||||
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
|
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
|
"lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" },
|
||||||
"lsp-zero.nvim": { "branch": "v2.x", "commit": "7b9627c2cb50906993e194290b2e539c95dfdf47" },
|
"lsp-zero.nvim": { "branch": "v2.x", "commit": "f084f4a6a716f55bf9c4026e73027bb24a0325a3" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" },
|
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "82685fdd0f67a694b244cb058b83761f54664d68" },
|
"markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "5ad3e113b0c3fde3caba8630599373046f6197e8" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "2997f467881ac4faa6f8c5e7065e3a672297c8ad" },
|
||||||
"neo-tree.nvim": { "branch": "v2.x", "commit": "7f6fa04dbd8e8c79d1af33bc90e856b65d8641da" },
|
"mason.nvim": { "branch": "main", "commit": "4a8deb615a477029a549cea5cef69d90e4d1f850" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "d146966a423e60699b084eeb28489fe3b6427599" },
|
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
||||||
"null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" },
|
"nvim-autopairs": { "branch": "master", "commit": "ae5b41ce880a6d850055e262d6dfebd362bb276e" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "e8f7dd7a72de3e7b6626c050a802000e69d53ff0" },
|
"nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "2743dd989e9b932e1b4813a4927d7b84272a14e2" },
|
"nvim-dap": { "branch": "master", "commit": "4377a05b9476587b7b485d6a9d9745768c4e4b37" },
|
||||||
"nvim-dap": { "branch": "master", "commit": "3bde6f786057fa29d8356559b2ae3a52d9317fba" },
|
|
||||||
"nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" },
|
"nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" },
|
||||||
"nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" },
|
"nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "deade69789089c3da15237697156334fb3e943f0" },
|
"nvim-lspconfig": { "branch": "master", "commit": "a27356f1ef9c11e1f459cc96a3fcac5c265e72d6" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "d9104a1d10023ed9e7eacf68639ad887425246eb" },
|
"nvim-treesitter": { "branch": "master", "commit": "4d41d9bfb09dd0836ce6910404e3cd570500c9ca" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "52f1f3280d9092bfaee5c45be5962fabee3d9654" },
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "e3e2b6de4ccf781fb653a3a1d397aeb4a0095609" },
|
||||||
"nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
|
"nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
|
||||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "7f625207f225eea97ef7a6abe7611e556c396d2f" },
|
"nvim-ts-context-commentstring": { "branch": "main", "commit": "9bff161dfece6ecf3459e6e46ca42e49f9ed939f" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "9ab9b0b894b2388a9dbcdee5f00ce72e25d85bf9" },
|
"nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "bda256fab0eb66a15e8190937e417e6a14ee5d72" },
|
"plenary.nvim": { "branch": "master", "commit": "0dbe561ae023f02c2fb772b879e905055b939ce3" },
|
||||||
"rose-pine": { "branch": "main", "commit": "932adb0d9351186db047302de021bb2976756a07" },
|
"rose-pine": { "branch": "main", "commit": "e29002cbee4854a9c8c4b148d8a52fae3176070f" },
|
||||||
"telescope-dap.nvim": { "branch": "master", "commit": "313d2ea12ae59a1ca51b62bf01fc941a983d9c9c" },
|
"telescope-dap.nvim": { "branch": "master", "commit": "313d2ea12ae59a1ca51b62bf01fc941a983d9c9c" },
|
||||||
|
"telescope-file-browser.nvim": { "branch": "master", "commit": "ad7b637c72549713b9aaed7c4f9c79c62bcbdff0" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" },
|
"telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" },
|
||||||
"todo-comments.nvim": { "branch": "main", "commit": "09b0b17d824d2d56f02ff15967e8a2499a89c731" },
|
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
|
||||||
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
|
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
|
||||||
"vim-floaterm": { "branch": "master", "commit": "bd0aee3c861d613f56b85bd9eaffdcab459071fd" },
|
"vim-floaterm": { "branch": "master", "commit": "bcaeabf89a92a924031d471395054d84bd88ce2f" },
|
||||||
"vscode-js-debug": { "branch": "main", "commit": "16b9a70171b94cfe4aafc49e991f93b87b8ffb77" },
|
"vscode-js-debug": { "branch": "main", "commit": "16b9a70171b94cfe4aafc49e991f93b87b8ffb77" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "96e99913df649d45333a9ad625ad4c72d5e65fe1" }
|
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }
|
||||||
}
|
}
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
return {
|
return {
|
||||||
"windwp/nvim-ts-autotag",
|
"windwp/nvim-ts-autotag",
|
||||||
dependencies = { "nvim-treesitter/nvim-treesitter", build = ':TSUpdate' },
|
dependencies = { "nvim-treesitter/nvim-treesitter", build = ':TSUpdate' },
|
||||||
ft = {
|
ft = {
|
||||||
"javascriptreact",
|
"javascriptreact",
|
||||||
"typescriptreact",
|
"typescriptreact",
|
||||||
"html"
|
"html"
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local autotag = require('nvim-ts-autotag')
|
local autotag = require('nvim-ts-autotag')
|
||||||
autotag.setup()
|
autotag.setup({
|
||||||
end
|
enable = true,
|
||||||
|
enable_close_on_slash = false,
|
||||||
|
})
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
|
||||||
9
.config/nvim/lua/plugins/markdown-preview.lua
Normal file
9
.config/nvim/lua/plugins/markdown-preview.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
return {
|
||||||
|
"iamcco/markdown-preview.nvim",
|
||||||
|
build = function()
|
||||||
|
vim.fn["mkdp#util#install"]()
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>mp", "<cmd>MarkdownPreview<CR>", desc = "Toggle [M]arkdown [P]review" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,70 +1,71 @@
|
||||||
return {
|
return {
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
branch = "v2.x",
|
enabled = false,
|
||||||
cmd = { "Neotree" },
|
branch = "v2.x",
|
||||||
keys = {
|
cmd = { "Neotree" },
|
||||||
{ "<leader>fs", "<cmd>NeoTreeFloatToggle<CR>", desc = "Toggle [F]ile [S]ystem Floating Menu" },
|
keys = {
|
||||||
{ "<C-b>", "<cmd>NeoTreeFocusToggle<CR>", desc = "Open Side File System" }
|
{ "<leader>fs", "<cmd>NeoTreeFloatToggle<CR>", desc = "Toggle [F]ile [S]ystem Floating Menu" },
|
||||||
},
|
{ "<C-b>", "<cmd>NeoTreeFocusToggle<CR>", desc = "Open Side File System" }
|
||||||
dependencies = {
|
},
|
||||||
"nvim-lua/plenary.nvim",
|
dependencies = {
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-lua/plenary.nvim",
|
||||||
"MunifTanjim/nui.nvim",
|
"nvim-tree/nvim-web-devicons",
|
||||||
},
|
"MunifTanjim/nui.nvim",
|
||||||
config = {
|
},
|
||||||
use_default_mappings = true,
|
config = {
|
||||||
mappings = {
|
use_default_mappings = true,
|
||||||
["<space>"] = {
|
mappings = {
|
||||||
"toggle_node",
|
["<space>"] = {
|
||||||
nowait = true, -- disable `nowait` if you have existing combos starting with this char that you want to use
|
"toggle_node",
|
||||||
},
|
nowait = true, -- disable `nowait` if you have existing combos starting with this char that you want to use
|
||||||
["<2-LeftMouse>"] = "open",
|
},
|
||||||
["<cr>"] = "open",
|
["<2-LeftMouse>"] = "open",
|
||||||
["<esc>"] = "cancel", -- close preview or floating neo-tree window
|
["<cr>"] = "open",
|
||||||
["P"] = { "toggle_preview", config = { use_float = true } },
|
["<esc>"] = "cancel", -- close preview or floating neo-tree window
|
||||||
["l"] = "focus_preview",
|
["P"] = { "toggle_preview", config = { use_float = true } },
|
||||||
["O"] = "open_split",
|
["l"] = "focus_preview",
|
||||||
["o"] = "open_vsplit",
|
["O"] = "open_split",
|
||||||
["S"] = "none",
|
["o"] = "open_vsplit",
|
||||||
["s"] = "none",
|
["S"] = "none",
|
||||||
-- ["S"] = "split_with_window_picker",
|
["s"] = "none",
|
||||||
-- ["s"] = "vsplit_with_window_picker",
|
-- ["S"] = "split_with_window_picker",
|
||||||
["t"] = "open_tabnew",
|
-- ["s"] = "vsplit_with_window_picker",
|
||||||
-- ["<cr>"] = "open_drop",
|
["t"] = "open_tabnew",
|
||||||
-- ["t"] = "open_tab_drop",
|
-- ["<cr>"] = "open_drop",
|
||||||
["w"] = "open_with_window_picker",
|
-- ["t"] = "open_tab_drop",
|
||||||
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
|
["w"] = "open_with_window_picker",
|
||||||
["C"] = "close_node",
|
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
|
||||||
-- ['C'] = 'close_all_subnodes',
|
["C"] = "close_node",
|
||||||
["z"] = "close_all_nodes",
|
-- ['C'] = 'close_all_subnodes',
|
||||||
--["Z"] = "expand_all_nodes",
|
["z"] = "close_all_nodes",
|
||||||
["a"] = {
|
--["Z"] = "expand_all_nodes",
|
||||||
"add",
|
["a"] = {
|
||||||
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
|
"add",
|
||||||
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
|
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
|
||||||
config = {
|
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
|
||||||
show_path = "none" -- "none", "relative", "absolute"
|
config = {
|
||||||
}
|
show_path = "none" -- "none", "relative", "absolute"
|
||||||
},
|
|
||||||
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
|
|
||||||
["d"] = "delete",
|
|
||||||
["r"] = "rename",
|
|
||||||
["y"] = "copy_to_clipboard",
|
|
||||||
["x"] = "cut_to_clipboard",
|
|
||||||
["p"] = "paste_from_clipboard",
|
|
||||||
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
|
|
||||||
-- ["c"] = {
|
|
||||||
-- "copy",
|
|
||||||
-- config = {
|
|
||||||
-- show_path = "none" -- "none", "relative", "absolute"
|
|
||||||
-- }
|
|
||||||
--}
|
|
||||||
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
|
|
||||||
["q"] = "close_window",
|
|
||||||
["R"] = "refresh",
|
|
||||||
["?"] = "show_help",
|
|
||||||
["<"] = "prev_source",
|
|
||||||
[">"] = "next_source",
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
|
||||||
|
["d"] = "delete",
|
||||||
|
["r"] = "rename",
|
||||||
|
["y"] = "copy_to_clipboard",
|
||||||
|
["x"] = "cut_to_clipboard",
|
||||||
|
["p"] = "paste_from_clipboard",
|
||||||
|
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
|
||||||
|
-- ["c"] = {
|
||||||
|
-- "copy",
|
||||||
|
-- config = {
|
||||||
|
-- show_path = "none" -- "none", "relative", "absolute"
|
||||||
|
-- }
|
||||||
|
--}
|
||||||
|
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
|
||||||
|
["q"] = "close_window",
|
||||||
|
["R"] = "refresh",
|
||||||
|
["?"] = "show_help",
|
||||||
|
["<"] = "prev_source",
|
||||||
|
[">"] = "next_source",
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
return {
|
return {
|
||||||
"nvim-telescope/telescope-file-browser.nvim",
|
"nvim-telescope/telescope-file-browser.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
},
|
},
|
||||||
enabled = false,
|
enabled = true,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,92 +1,92 @@
|
||||||
return {
|
return {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
version = "0.1.2",
|
version = "0.1.2",
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
config = function()
|
config = function()
|
||||||
local telescope = require("telescope")
|
local telescope = require("telescope")
|
||||||
local actions = require("telescope.actions")
|
local actions = require("telescope.actions")
|
||||||
local builtin = require("telescope.builtin")
|
local builtin = require("telescope.builtin")
|
||||||
-- local fb_actions = require "telescope".extensions.file_browser.actions
|
local fb_actions = require "telescope".extensions.file_browser.actions
|
||||||
--
|
|
||||||
-- local function telescope_buffer_dir()
|
|
||||||
-- return vim.fn.expand("%:p:h")
|
|
||||||
-- end
|
|
||||||
|
|
||||||
telescope.setup({
|
local function telescope_buffer_dir()
|
||||||
defaults = {
|
return vim.fn.expand("%:p:h")
|
||||||
mappings = {
|
|
||||||
n = {
|
|
||||||
['q'] = actions.close
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
-- extensions = {
|
|
||||||
-- file_browser = {
|
|
||||||
-- theme = "dropdown",
|
|
||||||
-- hijack_netrw = true,
|
|
||||||
-- hidden = true,
|
|
||||||
-- mappings = {
|
|
||||||
-- ['i'] = {
|
|
||||||
-- ['<C-w>'] = function() vim.cmd("normal vbd") end,
|
|
||||||
-- ['<C-j>'] = function(bufnr) actions.move_selection_next(bufnr) end,
|
|
||||||
-- ['<C-k>'] = function(bufnr) actions.move_selection_previous(bufnr) end,
|
|
||||||
-- ['<C-s>'] = function(bufnr) actions.select_vertical(bufnr) end,
|
|
||||||
-- },
|
|
||||||
-- ['n'] = {
|
|
||||||
-- ['N'] = fb_actions.create,
|
|
||||||
-- ['h'] = fb_actions.goto_parent_dir,
|
|
||||||
-- ['/'] = function() vim.cmd("startinsert") end,
|
|
||||||
-- ['D'] = fb_actions.remove,
|
|
||||||
-- ['<C-s>'] = function(bufnr) actions.select_vertical(bufnr) end,
|
|
||||||
-- ['<C-a>'] = function(bufnr) actions.toggle_all(bufnr) end,
|
|
||||||
-- }
|
|
||||||
-- }
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
})
|
|
||||||
|
|
||||||
-- pcall(telescope.load_extension, "file_browser")
|
|
||||||
pcall(telescope.load_extension, "fzf")
|
|
||||||
pcall(telescope.load_extension, "dap")
|
|
||||||
|
|
||||||
-- Builtin pickers
|
|
||||||
vim.keymap.set("n", "<leader>sf", function()
|
|
||||||
builtin.find_files({ no_ignore = false, hidden = true })
|
|
||||||
end, { desc = "[S]earch [F]iles" })
|
|
||||||
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp Tags" })
|
|
||||||
vim.keymap.set("n", "<leader>sb", builtin.buffers, { desc = "[S]earch [B]uffers" })
|
|
||||||
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch [W]ord" })
|
|
||||||
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
|
||||||
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
|
||||||
vim.keymap.set("n", "gr", builtin.lsp_references, { desc = "[G]o to [R]eferences", noremap = true })
|
|
||||||
|
|
||||||
-- Git pickers
|
|
||||||
vim.keymap.set("n", "<leader>gf", builtin.git_files, { desc = "Search [G]it [F]iles" })
|
|
||||||
vim.keymap.set("n", "<leader>gs", builtin.git_status, { desc = "List [G]it [S]tatus" })
|
|
||||||
vim.keymap.set("n", "<leader>gh", builtin.git_stash, { desc = "List [G]it [S]tash" })
|
|
||||||
vim.keymap.set("n", "<leader>gbb", builtin.git_branches, { desc = "List [G]it [B]ranches" })
|
|
||||||
vim.keymap.set("n", "<leader>gc", builtin.git_bcommits, { desc = "List Buffer [G]it [C]ommits" })
|
|
||||||
|
|
||||||
-- File Browser Ext
|
|
||||||
-- vim.keymap.set("n", "<leader>od",
|
|
||||||
-- function()
|
|
||||||
-- telescope.extensions.file_browser.file_browser({
|
|
||||||
-- path = "%:p:h",
|
|
||||||
-- cwd = telescope_buffer_dir(),
|
|
||||||
-- respect_gitignore = true,
|
|
||||||
-- hidden = true,
|
|
||||||
-- grouped = true,
|
|
||||||
-- previewer = false,
|
|
||||||
-- initial_mode = "normal",
|
|
||||||
-- layout_config = { height = 40 }
|
|
||||||
-- })
|
|
||||||
-- end, { desc = "[O]pen [D]irectory" })
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>/', function()
|
|
||||||
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown({
|
|
||||||
winblend = 10,
|
|
||||||
previewer = false,
|
|
||||||
}))
|
|
||||||
end, { desc = '[/] Fuzzily serach in current buffer' })
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
telescope.setup({
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
n = {
|
||||||
|
['q'] = actions.close
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
file_browser = {
|
||||||
|
theme = "dropdown",
|
||||||
|
hijack_netrw = false,
|
||||||
|
hidden = true,
|
||||||
|
mappings = {
|
||||||
|
['i'] = {
|
||||||
|
['<C-w>'] = function() vim.cmd("normal vbd") end,
|
||||||
|
['<C-j>'] = function(bufnr) actions.move_selection_next(bufnr) end,
|
||||||
|
['<C-k>'] = function(bufnr) actions.move_selection_previous(bufnr) end,
|
||||||
|
['<C-s>'] = function(bufnr) actions.select_vertical(bufnr) end,
|
||||||
|
},
|
||||||
|
['n'] = {
|
||||||
|
['a'] = fb_actions.create,
|
||||||
|
['h'] = fb_actions.goto_parent_dir,
|
||||||
|
['/'] = function() vim.cmd("startinsert") end,
|
||||||
|
['d'] = fb_actions.remove,
|
||||||
|
['<C-s>'] = function(bufnr) actions.select_vertical(bufnr) end,
|
||||||
|
['<C-a>'] = function(bufnr) actions.toggle_all(bufnr) end,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
pcall(telescope.load_extension, "file_browser")
|
||||||
|
pcall(telescope.load_extension, "fzf")
|
||||||
|
pcall(telescope.load_extension, "dap")
|
||||||
|
|
||||||
|
-- Builtin pickers
|
||||||
|
vim.keymap.set("n", "<leader>sf", function()
|
||||||
|
builtin.find_files({ no_ignore = false, hidden = true })
|
||||||
|
end, { desc = "[S]earch [F]iles" })
|
||||||
|
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp Tags" })
|
||||||
|
vim.keymap.set("n", "<leader>sb", builtin.buffers, { desc = "[S]earch [B]uffers" })
|
||||||
|
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch [W]ord" })
|
||||||
|
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
||||||
|
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
||||||
|
vim.keymap.set("n", "gr", builtin.lsp_references, { desc = "[G]o to [R]eferences", noremap = true })
|
||||||
|
|
||||||
|
-- Git pickers
|
||||||
|
vim.keymap.set("n", "<leader>gf", builtin.git_files, { desc = "Search [G]it [F]iles" })
|
||||||
|
vim.keymap.set("n", "<leader>gs", builtin.git_status, { desc = "List [G]it [S]tatus" })
|
||||||
|
vim.keymap.set("n", "<leader>gh", builtin.git_stash, { desc = "List [G]it [S]tash" })
|
||||||
|
vim.keymap.set("n", "<leader>gbb", builtin.git_branches, { desc = "List [G]it [B]ranches" })
|
||||||
|
vim.keymap.set("n", "<leader>gc", builtin.git_bcommits, { desc = "List Buffer [G]it [C]ommits" })
|
||||||
|
|
||||||
|
-- File Browser Ext
|
||||||
|
vim.keymap.set("n", "<leader>fs",
|
||||||
|
function()
|
||||||
|
telescope.extensions.file_browser.file_browser({
|
||||||
|
path = "%:p:h",
|
||||||
|
cwd = telescope_buffer_dir(),
|
||||||
|
respect_gitignore = true,
|
||||||
|
hidden = true,
|
||||||
|
grouped = true,
|
||||||
|
previewer = false,
|
||||||
|
initial_mode = "normal",
|
||||||
|
layout_config = { height = 40 }
|
||||||
|
})
|
||||||
|
end, { desc = "Open [F]ile [S]ystem Menu" })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>/', function()
|
||||||
|
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown({
|
||||||
|
winblend = 10,
|
||||||
|
previewer = false,
|
||||||
|
}))
|
||||||
|
end, { desc = '[/] Fuzzily serach in current buffer' })
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ return {
|
||||||
textobjects = {
|
textobjects = {
|
||||||
select = {
|
select = {
|
||||||
enable = true,
|
enable = true,
|
||||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||||
keymaps = {
|
keymaps = {
|
||||||
-- You can use the capture groups defined in textobjects.scm
|
-- You can use the capture groups defined in textobjects.scm
|
||||||
['aa'] = '@parameter.outer',
|
['aa'] = '@parameter.outer',
|
||||||
|
|
@ -53,7 +53,7 @@ return {
|
||||||
},
|
},
|
||||||
move = {
|
move = {
|
||||||
enable = true,
|
enable = true,
|
||||||
set_jumps = true, -- whether to set jumps in the jumplist
|
set_jumps = true, -- whether to set jumps in the jumplist
|
||||||
goto_next_start = {
|
goto_next_start = {
|
||||||
[']m'] = '@function.outer',
|
[']m'] = '@function.outer',
|
||||||
[']]'] = '@class.outer',
|
[']]'] = '@class.outer',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue