Compare commits
51 Commits
a19eaf6f85
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 42b683b62b | |||
| 30e7cf3d02 | |||
| b0296177f6 | |||
| d1c391a7ec | |||
| ca37a74180 | |||
| 19f6c5d5d2 | |||
| 550866878e | |||
| 434d371c57 | |||
| d509b8a159 | |||
| 446ec92655 | |||
| 805f2d06bb | |||
| 801d97d217 | |||
| 1cc9378eca | |||
| 03ce8091f0 | |||
| e8875ab86b | |||
| 6d0ec8559b | |||
| 1ca0bb9011 | |||
| 837a341c0d | |||
| de54ccfc01 | |||
| 9aec495a30 | |||
| 05e2f3ea8d | |||
| 7325ef4410 | |||
| caf3c2a681 | |||
| 5a4dd97777 | |||
| 345c313eeb | |||
| 4f98470a4e | |||
| dc027d7da5 | |||
| 7dd5258f9b | |||
| 0e56a7626a | |||
| d11cca64b7 | |||
| f4f7565427 | |||
| 656af4089c | |||
| 3524107556 | |||
| efaa44b924 | |||
| ea29d06a91 | |||
| e91d840f90 | |||
| 5c88830f93 | |||
| 0ab89f02ba | |||
| 8639ac6164 | |||
| 54b784f6ba | |||
| 4a9feb214f | |||
| 9cd140a8ec | |||
| 2d3cd3f637 | |||
| ccb4213dcb | |||
| b600491360 | |||
| e89461885d | |||
| 1f180f6618 | |||
| 065569b23c | |||
| fb8f30fdb8 | |||
| 58bd865aa3 | |||
| 5e81732a7c |
57
.aliases
57
.aliases
@@ -1,3 +1,31 @@
|
|||||||
|
# Complex aliasses
|
||||||
|
## Open notes folder in nvim then return
|
||||||
|
function notes() { cd $HOME/Notes; nvim; cd -; };
|
||||||
|
function sb() { cd $HOME/second-brain/; git pull; nvim; git add .; git commit; git push; cd -; };
|
||||||
|
|
||||||
|
## Open work folder with fuzzy finder
|
||||||
|
function work() {
|
||||||
|
work_dirs=( "$HOME/clones" "$HOME/sandbox" "$HOME/TA/" )
|
||||||
|
work_dirs=( $(find $work_dirs -maxdepth 0 -type d 2> /dev/null) )
|
||||||
|
goto=""
|
||||||
|
if [ ! -z $1 ]; then
|
||||||
|
goto=$(find $work_dirs -maxdepth 1 -mindepth 1 -type d | fzf -f $1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$goto" -o $(wc -l <<< "$goto") -ne 1 ]; then
|
||||||
|
goto=$(find $work_dirs -maxdepth 1 -mindepth 1 -type d | fzf --query=$1 --preview "tree -C -L 2 {}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -z $goto ] && return
|
||||||
|
if [ -z $TMUX ]; then
|
||||||
|
tmux new -A -s "$(basename -- $goto)" -c "$goto"
|
||||||
|
else
|
||||||
|
tmux new -d -s "$(basename -- $goto)" -c "$goto"
|
||||||
|
tmux switch-client -t "$(basename -- $goto | tr . _)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# simple
|
||||||
alias clj='rlwrap java -cp ~/Clojure/clojure-1.8.0.jar clojure.main'
|
alias clj='rlwrap java -cp ~/Clojure/clojure-1.8.0.jar clojure.main'
|
||||||
alias ll='ls -l'
|
alias ll='ls -l'
|
||||||
alias la='ls -A'
|
alias la='ls -A'
|
||||||
@@ -7,37 +35,20 @@ alias cdclip="cd \$(xclip -o -selection clipboard)"
|
|||||||
alias clipi='xclip -i -selection clipboard'
|
alias clipi='xclip -i -selection clipboard'
|
||||||
alias clipo='xclip -o -selection clipboard'
|
alias clipo='xclip -o -selection clipboard'
|
||||||
alias ssh-agent='ssh-agent -t 1h'
|
alias ssh-agent='ssh-agent -t 1h'
|
||||||
alias ssh-home='ssh home-server'
|
alias saa='eval $(ssh-agent) && ssh-add'
|
||||||
alias tmh='ssh home-server -t "tmux new -A -s sys"'
|
alias tm='tmux new -A'
|
||||||
alias tm='tmux new -A -s '
|
|
||||||
alias tms='tmux new -A -s sys'
|
|
||||||
alias hsfs='sshfs andrei@home-server:/utility /hsfs'
|
|
||||||
alias uhsfs='sudo umount /hsfs'
|
|
||||||
alias exfs='sudo zpool import external'
|
alias exfs='sudo zpool import external'
|
||||||
alias uexfs='sudo zpool export external'
|
alias uexfs='sudo zpool export external'
|
||||||
alias ta-media='rsync -avr /home/andrei/CSCI_4160/ home-server:/home/andrei/backups/school/TA/CSCI_4160_w19;'
|
|
||||||
alias ta-web='rsync -avr /home/andrei/CSCI_3230/ home-server:/home/andrei/backups/school/TA/CSCI_3230_w19;'
|
|
||||||
alias photo='rsync -avr /home/andrei/Pictures/* home-server:/utility/Photos/XPS_2018_VACATION/ --exclude="*_CR2_embedded.jpg"'
|
|
||||||
alias photo-local='rsync -avr ~/Pictures/* /media/andrei/External/Photos --exclude="*_CR2_embedded.jpg"'
|
|
||||||
alias socks='ssh -D 8081 -C -q -N home-server'
|
alias socks='ssh -D 8081 -C -q -N home-server'
|
||||||
alias gmonitor='while [ true ] ; do nvidia-smi; nvidia-settings -q gpucoretemp | grep gpu; sensors| grep CPU; sleep 1; clear; done'
|
alias gmonitor='while [ true ] ; do nvidia-smi; nvidia-settings -q gpucoretemp | grep gpu; sensors| grep CPU; sleep 1; clear; done'
|
||||||
alias saa='ssh-agent && ssh-add'
|
|
||||||
alias gssh='gcloud compute ssh'
|
|
||||||
alias gc='gcloud compute'
|
|
||||||
alias gci='gcloud compute instances'
|
|
||||||
alias gcls='gcloud compute instances list'
|
|
||||||
alias gcstart='gcloud compute instances start'
|
|
||||||
alias gcstop='gcloud compute instances stop'
|
|
||||||
alias gcstopall="gcls | grep RUNNING | awk '{print \$1}' | xargs -I{} gcloud compute instances stop {}"
|
|
||||||
alias gct='gcloud compute tpus'
|
|
||||||
alias gctls='gcloud compute tpus list'
|
|
||||||
alias gctstart='gcloud compute tpus start'
|
|
||||||
alias gctstop='gcloud compute tpus stop'
|
|
||||||
alias code='code-oss'
|
alias code='code-oss'
|
||||||
alias tf-docker='docker run --runtime=nvidia -it --rm -p 8888:8888 -v $PWD:/tf/local andrei/dev'
|
|
||||||
alias conda-activate='source /opt/anaconda/bin/activate'
|
alias conda-activate='source /opt/anaconda/bin/activate'
|
||||||
alias conda-deactivete='source /opt/anaconda/bin/deactivate'
|
alias conda-deactivete='source /opt/anaconda/bin/deactivate'
|
||||||
alias venv='python -m venv'
|
alias venv='python -m venv'
|
||||||
alias venv2='python2 -m venv'
|
alias venv2='python2 -m venv'
|
||||||
alias venv3='python3 -m venv'
|
alias venv3='python3 -m venv'
|
||||||
alias dotvenv='source .venv/bin/activate'
|
alias dotvenv='source .venv/bin/activate'
|
||||||
|
alias todo='rusty-tasks'
|
||||||
|
alias ccat='bat'
|
||||||
|
alias we='watchexec'
|
||||||
|
alias netcheck='ping 8.8.8.8'
|
||||||
|
|||||||
16
.bashrc
16
.bashrc
@@ -141,18 +141,4 @@ TERM=xterm-256color
|
|||||||
export VISUAL=vim
|
export VISUAL=vim
|
||||||
export EDITOR="$VISUAL"
|
export EDITOR="$VISUAL"
|
||||||
|
|
||||||
# >>> conda initialize >>>
|
. "$HOME/.cargo/env"
|
||||||
# !! Contents within this block are managed by 'conda init' !!
|
|
||||||
__conda_setup="$('/home/andrei/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
eval "$__conda_setup"
|
|
||||||
else
|
|
||||||
if [ -f "/home/andrei/miniconda3/etc/profile.d/conda.sh" ]; then
|
|
||||||
. "/home/andrei/miniconda3/etc/profile.d/conda.sh"
|
|
||||||
else
|
|
||||||
export PATH="/home/andrei/miniconda3/bin:$PATH"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
unset __conda_setup
|
|
||||||
# <<< conda initialize <<<
|
|
||||||
|
|
||||||
|
|||||||
1
.config/nvim
Submodule
1
.config/nvim
Submodule
Submodule .config/nvim added at a54d69c808
12
.gitconfig
12
.gitconfig
@@ -13,10 +13,18 @@
|
|||||||
d = diff
|
d = diff
|
||||||
dc = diff -cached
|
dc = diff -cached
|
||||||
lol = log --decorate --pretty=oneline --abbrev-commit
|
lol = log --decorate --pretty=oneline --abbrev-commit
|
||||||
lg = log --pretty=format:'%C(auto) %h,%C(green) \"%s\"%Creset, %aN,%C(blue) %cD'
|
lg = "log --pretty=format:'%C(auto) %h,%C(green) \"%s\"%Creset, %aN,%C(blue) %cD'"
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
editor = vim
|
editor = nvim
|
||||||
autocrlf = input
|
autocrlf = input
|
||||||
[init]
|
[init]
|
||||||
defaultBranch = main
|
defaultBranch = main
|
||||||
|
[merge]
|
||||||
|
tool = nvim
|
||||||
|
[mergetool]
|
||||||
|
keepBackup = false
|
||||||
|
[mergetool "nvim"]
|
||||||
|
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
|
||||||
|
[fetch]
|
||||||
|
all = true
|
||||||
|
|||||||
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[submodule ".config/nvim"]
|
||||||
|
path = .config/nvim
|
||||||
|
url = git@github.com:andrei-stoica/kickstart.nvim.git
|
||||||
|
branch = custom
|
||||||
@@ -73,8 +73,8 @@
|
|||||||
"KC_F",
|
"KC_F",
|
||||||
"KC_G",
|
"KC_G",
|
||||||
"KC_LEFT",
|
"KC_LEFT",
|
||||||
"KC_UP",
|
|
||||||
"KC_DOWN",
|
"KC_DOWN",
|
||||||
|
"KC_UP",
|
||||||
"KC_RGHT",
|
"KC_RGHT",
|
||||||
"KC_QUOT",
|
"KC_QUOT",
|
||||||
"KC_EQL",
|
"KC_EQL",
|
||||||
@@ -123,8 +123,8 @@
|
|||||||
"KC_F",
|
"KC_F",
|
||||||
"KC_G",
|
"KC_G",
|
||||||
"KC_HOME",
|
"KC_HOME",
|
||||||
"KC_PGUP",
|
|
||||||
"KC_PGDN",
|
"KC_PGDN",
|
||||||
|
"KC_PGUP",
|
||||||
"KC_END",
|
"KC_END",
|
||||||
"KC_F12",
|
"KC_F12",
|
||||||
"KC_ENT",
|
"KC_ENT",
|
||||||
@@ -173,8 +173,8 @@
|
|||||||
"KC_F",
|
"KC_F",
|
||||||
"KC_G",
|
"KC_G",
|
||||||
"KC_MPRV",
|
"KC_MPRV",
|
||||||
"KC_VOLU",
|
|
||||||
"KC_VOLD",
|
"KC_VOLD",
|
||||||
|
"KC_VOLU",
|
||||||
"KC_MNXT",
|
"KC_MNXT",
|
||||||
"KC_MUTE",
|
"KC_MUTE",
|
||||||
"KC_MPLY",
|
"KC_MPLY",
|
||||||
|
|||||||
3
.nvchad-custom/README.md
Normal file
3
.nvchad-custom/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Example_config
|
||||||
|
|
||||||
|
This can be used as an example custom config for NvChad, this branch is a minimal one. Do check the feature_full branch if you need all the ease in your config.
|
||||||
24
.nvchad-custom/chadrc.lua
Normal file
24
.nvchad-custom/chadrc.lua
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
---@type ChadrcConfig
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
-- Path to overriding theme and highlights files
|
||||||
|
local highlights = require "custom.highlights"
|
||||||
|
|
||||||
|
M.ui = {
|
||||||
|
theme = "onedark",
|
||||||
|
theme_toggle = { "onedark", "one_light" },
|
||||||
|
|
||||||
|
hl_override = highlights.override,
|
||||||
|
hl_add = highlights.add,
|
||||||
|
tabufline = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
M.plugins = "custom.plugins"
|
||||||
|
|
||||||
|
-- check core.mappings for table structure
|
||||||
|
M.mappings = require "custom.mappings"
|
||||||
|
|
||||||
|
return M
|
||||||
32
.nvchad-custom/configs/lspconfig.lua
Normal file
32
.nvchad-custom/configs/lspconfig.lua
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
local on_attach = require("plugins.configs.lspconfig").on_attach
|
||||||
|
local capabilities = require("plugins.configs.lspconfig").capabilities
|
||||||
|
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
|
-- if you just want default config for the servers then put them in a table
|
||||||
|
local servers = {
|
||||||
|
"html",
|
||||||
|
"cssls",
|
||||||
|
"tsserver",
|
||||||
|
"clangd",
|
||||||
|
"docker_compose_language_service",
|
||||||
|
"dockerls",
|
||||||
|
"rust_analyzer",
|
||||||
|
"pyright",
|
||||||
|
"grammarly",
|
||||||
|
"marksman",
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, lsp in ipairs(servers) do
|
||||||
|
lspconfig[lsp].setup({
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
lspconfig["clangd"].setup({
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = {
|
||||||
|
offsetEncoding = { "utf-16" },
|
||||||
|
},
|
||||||
|
})
|
||||||
36
.nvchad-custom/configs/null-ls.lua
Normal file
36
.nvchad-custom/configs/null-ls.lua
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
local present, null_ls = pcall(require, "null-ls")
|
||||||
|
|
||||||
|
if not present then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local b = null_ls.builtins
|
||||||
|
|
||||||
|
local sources = {
|
||||||
|
-- webdev stuff
|
||||||
|
b.formatting.deno_fmt, -- choosed deno for ts/js files cuz its very fast!
|
||||||
|
b.formatting.prettier.with { filetypes = { "html", "markdown", "css" } }, -- so prettier works only on these filetypes
|
||||||
|
|
||||||
|
-- Lua
|
||||||
|
b.formatting.stylua,
|
||||||
|
|
||||||
|
-- cpp
|
||||||
|
b.formatting.clang_format,
|
||||||
|
|
||||||
|
b.formatting.black.with({
|
||||||
|
extra_args = {"--line-length=82"}
|
||||||
|
}),
|
||||||
|
|
||||||
|
-- b.diagnostics.pylint.with({
|
||||||
|
-- diagnostic_config = { underline = false, virtual_text = false, signs = false },
|
||||||
|
-- method = null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||||
|
-- }),
|
||||||
|
|
||||||
|
b.formatting.rustfmt,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
null_ls.setup {
|
||||||
|
debug = true,
|
||||||
|
sources = sources,
|
||||||
|
}
|
||||||
72
.nvchad-custom/configs/nvim-ufo.lua
Normal file
72
.nvchad-custom/configs/nvim-ufo.lua
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
local desc = require('utils').plugin_keymap_desc('ufo')
|
||||||
|
|
||||||
|
-- Custom fold text handler for ufo showing line count folded
|
||||||
|
local handler = function(virtText, lnum, endLnum, width, truncate)
|
||||||
|
local newVirtText = {}
|
||||||
|
local suffix = (' %d '):format(endLnum - lnum)
|
||||||
|
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
||||||
|
local targetWidth = width - sufWidth
|
||||||
|
local curWidth = 0
|
||||||
|
|
||||||
|
for _, chunk in ipairs(virtText) do
|
||||||
|
local chunkText = chunk[1]
|
||||||
|
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||||
|
if targetWidth > curWidth + chunkWidth then
|
||||||
|
table.insert(newVirtText, chunk)
|
||||||
|
else
|
||||||
|
chunkText = truncate(chunkText, targetWidth - curWidth)
|
||||||
|
local hlGroup = chunk[2]
|
||||||
|
table.insert(newVirtText, {chunkText, hlGroup})
|
||||||
|
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||||
|
-- str width returned from truncate() may less than 2nd argument, need padding
|
||||||
|
if curWidth + chunkWidth < targetWidth then
|
||||||
|
suffix = suffix .. (' '):rep(targetWidth - curWidth - chunkWidth)
|
||||||
|
end
|
||||||
|
break
|
||||||
|
end
|
||||||
|
curWidth = curWidth + chunkWidth
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(newVirtText, {suffix, 'MoreMsg'})
|
||||||
|
return newVirtText
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'luukvbaal/statuscol.nvim',
|
||||||
|
config = function()
|
||||||
|
local builtin = require('statuscol.builtin')
|
||||||
|
require('statuscol').setup({
|
||||||
|
segments = {
|
||||||
|
{text = {builtin.foldfunc}, click = 'v:lua.ScFa'},
|
||||||
|
{text = {' %s'}, click = 'v:lua.ScSa'},
|
||||||
|
{text = {builtin.lnumfunc, ' '}, condition = {true, builtin.not_empty}, click = 'v:lua.ScLa'},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
'kevinhwang91/nvim-ufo',
|
||||||
|
dependencies = {'kevinhwang91/promise-async'},
|
||||||
|
opts = {
|
||||||
|
fold_virt_text_handler = handler,
|
||||||
|
provider_selector = function(bufnr, filetype, buftype)
|
||||||
|
return {'treesitter', 'indent'}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
local ufo = require('ufo')
|
||||||
|
ufo.setup(opts)
|
||||||
|
|
||||||
|
vim.keymap.set('n', 'zR', ufo.openAllFolds, {desc = desc('Open all folds')})
|
||||||
|
vim.keymap.set('n', 'zM', ufo.closeAllFolds, {desc = desc('Close all folds')})
|
||||||
|
vim.keymap.set('n', 'K', function()
|
||||||
|
local winid = ufo.peekFoldedLinesUnderCursor(true)
|
||||||
|
if not winid then
|
||||||
|
vim.lsp.buf.hover()
|
||||||
|
end
|
||||||
|
end, {desc = 'LSP: Show hover documentation and folded code'})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
}
|
||||||
128
.nvchad-custom/configs/overrides.lua
Normal file
128
.nvchad-custom/configs/overrides.lua
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.treesitter = {
|
||||||
|
ensure_installed = {
|
||||||
|
"typescript",
|
||||||
|
"python",
|
||||||
|
"tsx",
|
||||||
|
"c",
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"lua",
|
||||||
|
"luadoc",
|
||||||
|
"luap",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"query",
|
||||||
|
"regex",
|
||||||
|
"vim",
|
||||||
|
"vimdoc",
|
||||||
|
"bash",
|
||||||
|
"html",
|
||||||
|
"css",
|
||||||
|
"javascript",
|
||||||
|
"yaml",
|
||||||
|
"julia",
|
||||||
|
"r",
|
||||||
|
},
|
||||||
|
indent = {
|
||||||
|
enable = true,
|
||||||
|
-- disable = {
|
||||||
|
-- "python"
|
||||||
|
-- },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
M.mason = {
|
||||||
|
ensure_installed = {
|
||||||
|
-- lua stuff
|
||||||
|
"lua-language-server",
|
||||||
|
"stylua",
|
||||||
|
|
||||||
|
-- web dev stuff
|
||||||
|
"css-lsp",
|
||||||
|
"html-lsp",
|
||||||
|
"typescript-language-server",
|
||||||
|
"deno",
|
||||||
|
"prettier",
|
||||||
|
|
||||||
|
-- c/cpp stuff
|
||||||
|
"clangd",
|
||||||
|
"clang-format",
|
||||||
|
|
||||||
|
"jedi_language_server",
|
||||||
|
|
||||||
|
"docker_compose_language_service",
|
||||||
|
"dockerls",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- git support in nvimtree
|
||||||
|
M.nvimtree = {
|
||||||
|
git = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
renderer = {
|
||||||
|
highlight_git = true,
|
||||||
|
icons = {
|
||||||
|
show = {
|
||||||
|
git = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
M.cmp = function(_, opts)
|
||||||
|
local cmp = require("cmp")
|
||||||
|
opts.experimental = {
|
||||||
|
ghost_text = true,
|
||||||
|
}
|
||||||
|
opts.sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "nvim_lua" },
|
||||||
|
{ name = "path" },
|
||||||
|
{ name = "buffer", keyword_length = 5 },
|
||||||
|
})
|
||||||
|
|
||||||
|
opts.mapping = cmp.config.mapping({
|
||||||
|
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||||
|
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||||
|
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<C-e>"] = cmp.mapping.close(),
|
||||||
|
["<C-y>"] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Insert,
|
||||||
|
select = true,
|
||||||
|
}),
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif require("luasnip").expand_or_jumpable() then
|
||||||
|
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {
|
||||||
|
"i",
|
||||||
|
"s",
|
||||||
|
}),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif require("luasnip").jumpable(-1) then
|
||||||
|
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {
|
||||||
|
"i",
|
||||||
|
"s",
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
return opts
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
19
.nvchad-custom/highlights.lua
Normal file
19
.nvchad-custom/highlights.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
-- To find any highlight groups: "<cmd> Telescope highlights"
|
||||||
|
-- Each highlight group can take a table with variables fg, bg, bold, italic, etc
|
||||||
|
-- base30 variable names can also be used as colors
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
---@type Base46HLGroupsList
|
||||||
|
M.override = {
|
||||||
|
Comment = {
|
||||||
|
italic = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
---@type HLTable
|
||||||
|
M.add = {
|
||||||
|
NvimTreeOpenedFolderName = { fg = "green", bold = true },
|
||||||
|
}
|
||||||
|
|
||||||
|
return M
|
||||||
30
.nvchad-custom/init.lua
Normal file
30
.nvchad-custom/init.lua
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
-- local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
|
-- Auto resize panes when resizing nvim window
|
||||||
|
-- autocmd("VimResized", {
|
||||||
|
-- pattern = "*",
|
||||||
|
-- command = "tabdo wincmd =",
|
||||||
|
-- })
|
||||||
|
|
||||||
|
vim.wo.relativenumber = true
|
||||||
|
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.linebreak = true
|
||||||
|
vim.opt.showbreak = "+++"
|
||||||
|
vim.opt.showmatch = true
|
||||||
|
vim.opt.visualbell = true
|
||||||
|
vim.opt.hlsearch = true
|
||||||
|
vim.opt.smartcase = true
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
vim.opt.incsearch = true
|
||||||
|
vim.opt.autoindent = true
|
||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
vim.opt.ruler = true
|
||||||
|
vim.opt.softtabstop = 2
|
||||||
|
vim.opt.tabstop = 2
|
||||||
|
vim.opt.undolevels = 1000
|
||||||
|
vim.opt.backspace = "indent,eol,start"
|
||||||
|
vim.opt.colorcolumn = "80"
|
||||||
|
vim.opt.conceallevel = 2
|
||||||
87
.nvchad-custom/mappings.lua
Normal file
87
.nvchad-custom/mappings.lua
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
---@type MappingsTable
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
local function toggle_telescope(harpoon_files)
|
||||||
|
local conf = require("telescope.config").values
|
||||||
|
local file_paths = {}
|
||||||
|
for _, item in ipairs(harpoon_files.items) do
|
||||||
|
table.insert(file_paths, item.value)
|
||||||
|
end
|
||||||
|
|
||||||
|
require("telescope.pickers").new({}, {
|
||||||
|
prompt_title = "Harpoon",
|
||||||
|
finder = require("telescope.finders").new_table({
|
||||||
|
results = file_paths,
|
||||||
|
}),
|
||||||
|
previewer = conf.file_previewer({}),
|
||||||
|
sorter = conf.generic_sorter({}),
|
||||||
|
}):find()
|
||||||
|
end
|
||||||
|
|
||||||
|
M.general = {
|
||||||
|
n = {
|
||||||
|
-- harpoon
|
||||||
|
["H"] = {
|
||||||
|
function()
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
toggle_telescope(harpoon:list())
|
||||||
|
--harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||||
|
end,
|
||||||
|
"Open Harpoon in telescope",
|
||||||
|
},
|
||||||
|
["<leader>hh"] = {
|
||||||
|
function()
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||||
|
end,
|
||||||
|
"Open Harpoon",
|
||||||
|
},
|
||||||
|
["<leader>ha"] = {
|
||||||
|
function()
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
harpoon:list():append()
|
||||||
|
end,
|
||||||
|
"Add file to Harpoon",
|
||||||
|
},
|
||||||
|
["<leader>hs"] = {
|
||||||
|
function()
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
harpoon:list():select(1)
|
||||||
|
end,
|
||||||
|
"Switch to file 1",
|
||||||
|
},
|
||||||
|
["<leader>hd"] = {
|
||||||
|
function()
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
harpoon:list():select(2)
|
||||||
|
end,
|
||||||
|
"Switch to file 2",
|
||||||
|
},
|
||||||
|
["<leader>hf"] = {
|
||||||
|
function()
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
harpoon:list():select(3)
|
||||||
|
end,
|
||||||
|
"Switch to file 3",
|
||||||
|
},
|
||||||
|
["<leader>hg"] = {
|
||||||
|
function()
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
harpoon:list():select(4)
|
||||||
|
end,
|
||||||
|
"Switch to file 4",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- navigation
|
||||||
|
["<C-d>"] = { "<C-d>zz", "1/2 page down" },
|
||||||
|
["<C-u>"] = { "<C-u>zz", "1/2 page up" },
|
||||||
|
["n"] = { "nzz", "find next" },
|
||||||
|
["N"] = { "Nzz", "find prev" },
|
||||||
|
|
||||||
|
["Zm"] = { ":ZenMode<CR>", "Enter ZenMode" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- more keybinds!
|
||||||
|
|
||||||
|
return M
|
||||||
264
.nvchad-custom/plugins.lua
Normal file
264
.nvchad-custom/plugins.lua
Normal file
@@ -0,0 +1,264 @@
|
|||||||
|
local overrides = require("custom.configs.overrides")
|
||||||
|
|
||||||
|
---@type NvPluginSpec[]
|
||||||
|
local plugins = {
|
||||||
|
{
|
||||||
|
"folke/twilight.nvim",
|
||||||
|
opts = {
|
||||||
|
context = 20,
|
||||||
|
expand = {
|
||||||
|
"function",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lazy = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/zen-mode.nvim",
|
||||||
|
opts = {
|
||||||
|
tmux = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lazy = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alexghergh/nvim-tmux-navigation",
|
||||||
|
lazy = false,
|
||||||
|
},
|
||||||
|
-- Override plugin definition options
|
||||||
|
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
opts = overrides.cmp,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = {
|
||||||
|
-- format & linting
|
||||||
|
{
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
config = function()
|
||||||
|
require("custom.configs.null-ls")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("plugins.configs.lspconfig")
|
||||||
|
require("custom.configs.lspconfig")
|
||||||
|
end, -- Override to setup mason-lspconfig
|
||||||
|
opts = {
|
||||||
|
---@type lspconfig.options
|
||||||
|
servers = {
|
||||||
|
pyright = {},
|
||||||
|
r_language_server = {},
|
||||||
|
julials = {},
|
||||||
|
marksman = {
|
||||||
|
-- also needs:
|
||||||
|
-- $home/.config/marksman/config.toml :
|
||||||
|
-- [core]
|
||||||
|
-- markdown.file_extensions = ["md", "markdown", "qmd"]
|
||||||
|
filetypes = { "markdown", "quarto" },
|
||||||
|
root_dir = require("lspconfig.util").root_pattern(".git", ".marksman.toml", "_quarto.yml"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- override plugin configs
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = overrides.mason,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
setup = {
|
||||||
|
ensure_installed = { "jedi" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = overrides.treesitter,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
opts = overrides.nvimtree,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Install a plugin
|
||||||
|
{
|
||||||
|
"max397574/better-escape.nvim",
|
||||||
|
event = "InsertEnter",
|
||||||
|
config = function()
|
||||||
|
require("better_escape").setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "nvim-treesitter/nvim-treesitter-context", lazy = false },
|
||||||
|
|
||||||
|
{
|
||||||
|
"theprimeagen/harpoon",
|
||||||
|
branch = "harpoon2",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
config = function(_, opts)
|
||||||
|
local harpoon = require("harpoon")
|
||||||
|
harpoon:setup({
|
||||||
|
settings = {
|
||||||
|
save_on_toggle = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"simrat39/rust-tools.nvim",
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"ellisonleao/glow.nvim",
|
||||||
|
config = true,
|
||||||
|
cmd = "Glow",
|
||||||
|
event = "BufEnter *.md",
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"kevinhwang91/nvim-ufo",
|
||||||
|
requires = "kevinhwang91/promise-async",
|
||||||
|
lazy = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"epwalsh/obsidian.nvim",
|
||||||
|
version = "*", -- recommended, use latest release instead of latest commit
|
||||||
|
lazy = true,
|
||||||
|
ft = "markdown",
|
||||||
|
-- ft = {
|
||||||
|
-- "BufReadPre ~/Notes/**.md",
|
||||||
|
-- "BufNewFile ~/Notes/**.md",
|
||||||
|
-- },
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
opts = {
|
||||||
|
workspaces = {
|
||||||
|
{ name = "second-brain", path = "~/second-brain" },
|
||||||
|
},
|
||||||
|
new_notes_location = "notes_subdir",
|
||||||
|
daily_notes = { folder = "notes/dailies" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Disable nvchad plugins
|
||||||
|
{
|
||||||
|
"folke/todo-comments.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
lazy = false,
|
||||||
|
opts = {
|
||||||
|
-- your configuration comes here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
-- refer to the configuration section below
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"quarto-dev/quarto-nvim",
|
||||||
|
opts = {
|
||||||
|
lspFeatures = {
|
||||||
|
languages = { "r", "python", "julia", "bash", "html", "lua" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ft = "quarto",
|
||||||
|
keys = {
|
||||||
|
{ "<leader>qa", ":QuartoActivate<cr>", desc = "quarto activate" },
|
||||||
|
{ "<leader>qp", ":lua require'quarto'.quartoPreview()<cr>", desc = "quarto preview" },
|
||||||
|
{ "<leader>qq", ":lua require'quarto'.quartoClosePreview()<cr>", desc = "quarto close" },
|
||||||
|
{ "<leader>qh", ":QuartoHelp ", desc = "quarto help" },
|
||||||
|
{ "<leader>qe", ":lua require'otter'.export()<cr>", desc = "quarto export" },
|
||||||
|
{ "<leader>qE", ":lua require'otter'.export(true)<cr>", desc = "quarto export overwrite" },
|
||||||
|
{ "<leader>qrr", ":QuartoSendAbove<cr>", desc = "quarto run to cursor" },
|
||||||
|
{ "<leader>qra", ":QuartoSendAll<cr>", desc = "quarto run all" },
|
||||||
|
{ "<leader><cr>", ":SlimeSend<cr>", desc = "send code chunk" },
|
||||||
|
{ "<c-cr>", ":SlimeSend<cr>", desc = "send code chunk" },
|
||||||
|
{ "<c-cr>", "<esc>:SlimeSend<cr>i", mode = "i", desc = "send code chunk" },
|
||||||
|
{ "<c-cr>", "<Plug>SlimeRegionSend<cr>", mode = "v", desc = "send code chunk" },
|
||||||
|
{ "<cr>", "<Plug>SlimeRegionSend<cr>", mode = "v", desc = "send code chunk" },
|
||||||
|
{ "<leader>ctr", ":split term://R<cr>", desc = "terminal: R" },
|
||||||
|
{ "<leader>cti", ":split term://ipython<cr>", desc = "terminal: ipython" },
|
||||||
|
{ "<leader>ctp", ":split term://python<cr>", desc = "terminal: python" },
|
||||||
|
{ "<leader>ctj", ":split term://julia<cr>", desc = "terminal: julia" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"jmbuhr/otter.nvim",
|
||||||
|
opts = {
|
||||||
|
buffers = {
|
||||||
|
set_filetype = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Disable nvchad plugins
|
||||||
|
|
||||||
|
{
|
||||||
|
"tpope/vim-sleuth",
|
||||||
|
lazy = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"debugloop/telescope-undo.nvim",
|
||||||
|
dependencies = { -- note how they're inverted to above example
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ -- lazy style key map
|
||||||
|
"<leader>u",
|
||||||
|
"<cmd>Telescope undo<cr>",
|
||||||
|
desc = "undo history",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
-- don't use `defaults = { }` here, do this in the main telescope spec
|
||||||
|
extensions = {
|
||||||
|
undo = {
|
||||||
|
-- telescope-undo.nvim config, see below
|
||||||
|
},
|
||||||
|
-- no other extensions here, they can have their own spec too
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
-- Calling telescope's setup from multiple specs does not hurt, it will happily merge the
|
||||||
|
-- configs for us. We won't use data, as everything is in it's own namespace (telescope
|
||||||
|
-- defaults, as well as each extension).
|
||||||
|
require("telescope").setup(opts)
|
||||||
|
require("telescope").load_extension("undo")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"sindrets/diffview.nvim",
|
||||||
|
lazy = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"NvChad/nvterm",
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- To make a plugin not be loaded
|
||||||
|
-- {
|
||||||
|
-- "NvChad/nvim-colorizer.lua",
|
||||||
|
-- enabled = false
|
||||||
|
-- },
|
||||||
|
|
||||||
|
-- All NvChad plugins are lazy-loaded by default
|
||||||
|
-- For a plugin to be loaded, you will need to set either `ft`, `cmd`, `keys`, `event`, or set `lazy = false`
|
||||||
|
-- If you want a plugin to load on startup, add `lazy = false` to a plugin spec, for example
|
||||||
|
-- {
|
||||||
|
-- "mg979/vim-visual-multi",
|
||||||
|
-- lazy = false,
|
||||||
|
-- }
|
||||||
|
}
|
||||||
|
|
||||||
|
return plugins
|
||||||
72
.playbook/dev-pb.yaml
Normal file
72
.playbook/dev-pb.yaml
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Setup dev environment
|
||||||
|
hosts: localhost
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- name: update cache
|
||||||
|
become: true
|
||||||
|
when: ansible_facts['distribution'] == "Ubuntu"
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: install pacstall
|
||||||
|
become: yes
|
||||||
|
when: ansible_facts['distribution'] == "Ubuntu"
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: bash -c "$(curl -fsSL https://pacstall.dev/q/install)"
|
||||||
|
creates: /usr/bin/pacstall
|
||||||
|
|
||||||
|
|
||||||
|
- name: install most tools
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt:
|
||||||
|
pkg:
|
||||||
|
- curl
|
||||||
|
- tmux
|
||||||
|
- git
|
||||||
|
- htop
|
||||||
|
- build-essential
|
||||||
|
- fzf
|
||||||
|
- xclip
|
||||||
|
- zsh
|
||||||
|
- yadm
|
||||||
|
|
||||||
|
- name: install tailscale
|
||||||
|
become: yes
|
||||||
|
become_user: andrei
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: sh -c "$(curl -fsSL https://tailscale.com/install.sh)"
|
||||||
|
creates: /usr/bin/tailscale
|
||||||
|
|
||||||
|
|
||||||
|
- name: instll nvchad
|
||||||
|
become: yes
|
||||||
|
become_user: andrei
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: "git clone https://github.com/NvChad/NvChad /home/andrei/.config/nvim --depth 1"
|
||||||
|
creates: /home/andrei/.config/nvim
|
||||||
|
|
||||||
|
- name : install oh-my-zsh
|
||||||
|
become: yes
|
||||||
|
become_user: andrei
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended
|
||||||
|
creates: /home/andrei/.oh-my-zsh
|
||||||
|
|
||||||
|
|
||||||
|
- name : retrieve dotfiles
|
||||||
|
become: yes
|
||||||
|
become_user: andrei
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: yadm clone https://github.com/andrei-stoica/dotfiles.git
|
||||||
|
creates: /home/andrei/.local/share/yadm/repo.git
|
||||||
|
|
||||||
|
- name: install nvchad custom config
|
||||||
|
become: yes
|
||||||
|
become_user: andrei
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: ln -s /home/andrei/.nvchad-custom /home/andrei/.config/nvim/lua/custom
|
||||||
|
creates: /home/andrei/.config/nvim/lua/custom
|
||||||
|
|
||||||
|
|
||||||
85
.tmux.conf##default
Normal file
85
.tmux.conf##default
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
# plugins
|
||||||
|
set -g @plugin 'alexghergh/nvim-tmux-navigation'
|
||||||
|
|
||||||
|
run '~/.tmux/plugins/tpm/tpm'
|
||||||
|
|
||||||
|
# remap prefix from 'C-b' to 'C-a'
|
||||||
|
unbind C-b
|
||||||
|
set-option -g prefix C-a
|
||||||
|
bind-key C-a send-prefix
|
||||||
|
|
||||||
|
# Enable mouse control (clickable windows, panes, resizable panes)
|
||||||
|
set -g mouse on
|
||||||
|
|
||||||
|
# Initialize sesions
|
||||||
|
bind W source-file ~/.tmux/work
|
||||||
|
|
||||||
|
# reload config
|
||||||
|
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
|
||||||
|
|
||||||
|
# spliting windoww
|
||||||
|
unbind %
|
||||||
|
unbind '"'
|
||||||
|
bind | split-window -h -c "#{pane_current_path}"
|
||||||
|
bind - split-window -v -c "#{pane_current_path}"
|
||||||
|
|
||||||
|
# sync panes
|
||||||
|
unbind b
|
||||||
|
bind b setw synchronize-panes
|
||||||
|
|
||||||
|
# reset working dir for session
|
||||||
|
unbind h
|
||||||
|
bind h attach-session -t . -c "#{pane_current_path}"
|
||||||
|
|
||||||
|
# status bar
|
||||||
|
set -g status-right '#[fg=black]◢#[bg=black fg=colour135] %H:%M #[fg=default]%b %d %Y '
|
||||||
|
if-shell 'test "$(acpi -t)"' {
|
||||||
|
set -g status-right '#[fg=black]◢#[bg=black fg=colour135] %H:%M #[fg=default]%b %d %Y #[fg=pink] ♥#(acpi | cut -d ',' -f 2) '
|
||||||
|
}
|
||||||
|
|
||||||
|
# Start windows and panes at 1, not 0
|
||||||
|
set -g base-index 1
|
||||||
|
set -g pane-base-index 1
|
||||||
|
set-window-option -g pane-base-index 1
|
||||||
|
set-option -g renumber-windows on
|
||||||
|
|
||||||
|
# Smart pane switching with awareness of Vim splits.
|
||||||
|
# See: https://github.com/christoomey/vim-tmux-navigator
|
||||||
|
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
||||||
|
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
|
||||||
|
bind-key -n -T prefix k if-shell "${is_vim}" 'send-keys C-h' 'select-pane -L'
|
||||||
|
bind-key -n -T prefix j if-shell "${is_vim}" 'send-keys C-j' 'select-pane -D'
|
||||||
|
bind-key -n -T prefix h if-shell "${is_vim}" 'send-keys C-k' 'select-pane -U'
|
||||||
|
bind-key -n -T prefix l if-shell "${is_vim}" 'send-keys C-l' 'select-pane -R'
|
||||||
|
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
|
||||||
|
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
|
||||||
|
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
|
||||||
|
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
|
||||||
|
|
||||||
|
# resize
|
||||||
|
bind-key -r -T prefix M-k resize-pane -U
|
||||||
|
bind-key -r -T prefix M-j resize-pane -D
|
||||||
|
bind-key -r -T prefix M-h resize-pane -L
|
||||||
|
bind-key -r -T prefix M-l resize-pane -R
|
||||||
|
|
||||||
|
bind-key -r -T prefix k select-pane -U
|
||||||
|
bind-key -r -T prefix j select-pane -D
|
||||||
|
bind-key -r -T prefix h select-pane -L
|
||||||
|
bind-key -r -T prefix l select-pane -R
|
||||||
|
|
||||||
|
bind C-l send-keys 'C-l'
|
||||||
|
|
||||||
|
set-option -g allow-passthrough on
|
||||||
|
|
||||||
|
set -g default-terminal "screen-256color"
|
||||||
|
|
||||||
|
# status and culors
|
||||||
|
set -g status-left-length 85
|
||||||
|
set -g status-left "#[bg=black]#[fg=#(pomodoro tmux-color)]#(pomodoro status -f ' %!r') #[fg=default]working on#[fg=colour135] #S#[bg=default fg=black]◣"
|
||||||
|
set -g window-status-current-format "#[fg=colour135]#W"
|
||||||
|
set -g status-style bg=default
|
||||||
|
set -g pane-active-border-style fg=colour135
|
||||||
|
set -g status-justify centre
|
||||||
|
set-option -g status-interval 1
|
||||||
|
set-option -g clock-mode-color colour135
|
||||||
|
set-option -g message-style fg=colour135,bg=black
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
# remap prefix from 'C-b' to 'C-a'
|
|
||||||
unbind C-b
|
|
||||||
set-option -g prefix C-a
|
|
||||||
bind-key C-a send-prefix
|
|
||||||
|
|
||||||
# Enable mouse control (clickable windows, panes, resizable panes)
|
|
||||||
set -g mouse on
|
|
||||||
|
|
||||||
# Initialize sesions
|
|
||||||
bind W source-file ~/.tmux/work
|
|
||||||
|
|
||||||
# reload config
|
|
||||||
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
|
|
||||||
|
|
||||||
# spliting windoww
|
|
||||||
unbind %
|
|
||||||
unbind '"'
|
|
||||||
bind | split-window -h
|
|
||||||
bind - split-window -v
|
|
||||||
|
|
||||||
# sync panes
|
|
||||||
bind S setw synchronize-panes
|
|
||||||
|
|
||||||
# setting vi mode
|
|
||||||
set-window-option -g mode-keys vi
|
|
||||||
|
|
||||||
# status bar
|
|
||||||
set -g status-right '♥#(acpi | cut -d ',' -f 2) | %H:%m %d-%b-%y '
|
|
||||||
|
|
||||||
# default shell
|
|
||||||
#set -g default-terminal "screen-256color" /bin/bash
|
|
||||||
#set-option -g default-shell /bin/bash
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
# remap prefix from 'C-b' to 'C-a'
|
|
||||||
unbind C-b
|
|
||||||
set-option -g prefix C-a
|
|
||||||
bind-key C-a send-prefix
|
|
||||||
|
|
||||||
# Enable mouse control (clickable windows, panes, resizable panes)
|
|
||||||
set -g mouse on
|
|
||||||
|
|
||||||
# Initialize sesions
|
|
||||||
bind W source-file ~/.tmux/work
|
|
||||||
|
|
||||||
# reload config
|
|
||||||
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
|
|
||||||
|
|
||||||
# spliting windoww
|
|
||||||
unbind %
|
|
||||||
unbind '"'
|
|
||||||
bind | split-window -h
|
|
||||||
bind - split-window -v
|
|
||||||
|
|
||||||
|
|
||||||
# status bar
|
|
||||||
set -g status-right '%H:%m %d-%b-%y '
|
|
||||||
60
.zshrc
60
.zshrc
@@ -1,20 +1,20 @@
|
|||||||
|
zmodload zsh/zprof
|
||||||
# If you come from bash you might have to change your $PATH.
|
# If you come from bash you might have to change your $PATH.
|
||||||
export PATH=$HOME/bin:/usr/local/bin:/usr/lib64/openjdk-17/bin:$PATH
|
export PATH=$HOME/bin:/usr/local/bin:/usr/lib65/openjdk-17/bin:$PATH
|
||||||
|
|
||||||
# Path to your oh-my-zsh installation.
|
# Path to your oh-my-zsh installation.
|
||||||
export ZSH=/home/andrei/.oh-my-zsh
|
export ZSH=$HOME/.oh-my-zsh
|
||||||
|
|
||||||
# Set name of the theme to load. Optionally, if you set this to "random"
|
# Set name of the theme to load. Optionally, if you set this to "random"
|
||||||
# it'll load a random theme each time that oh-my-zsh is loaded.
|
# it'll load a random theme each time that oh-my-zsh is loaded.
|
||||||
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
|
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes ZSH_THEME="blokkzh"
|
||||||
ZSH_THEME="blokkzh"
|
|
||||||
|
|
||||||
# Set list of themes to load
|
# Set list of themes to load
|
||||||
# Setting this variable when ZSH_THEME="blokkzh"
|
# Setting this variable when ZSH_THEME="blokkzh"
|
||||||
# cause zsh load theme from this variable instead of
|
# cause zsh load theme from this variable instead of
|
||||||
# looking in ~/.oh-my-zsh/themes/
|
# looking in ~/.oh-my-zsh/themes/
|
||||||
# An empty array have no effect
|
# An empty array have no effect
|
||||||
# ZSH_THEME="blokkzh"
|
ZSH_THEME="blokkzh"
|
||||||
|
|
||||||
# Uncomment the following line to use case-sensitive completion.
|
# Uncomment the following line to use case-sensitive completion.
|
||||||
# CASE_SENSITIVE="true"
|
# CASE_SENSITIVE="true"
|
||||||
@@ -73,7 +73,11 @@ source $ZSH/oh-my-zsh.sh
|
|||||||
|
|
||||||
# Preferred editor for local and remote sessions
|
# Preferred editor for local and remote sessions
|
||||||
# if [[ -n $SSH_CONNECTION ]]; then
|
# if [[ -n $SSH_CONNECTION ]]; then
|
||||||
|
if [[ -e /usr/bin/nvim ]]; then
|
||||||
|
export EDITOR='nvim'
|
||||||
|
else
|
||||||
export EDITOR='vim'
|
export EDITOR='vim'
|
||||||
|
fi
|
||||||
# else
|
# else
|
||||||
# export EDITOR='mvim'
|
# export EDITOR='mvim'
|
||||||
# fi
|
# fi
|
||||||
@@ -98,35 +102,23 @@ autoload -z edit-command-line
|
|||||||
zle -N edit-command-line
|
zle -N edit-command-line
|
||||||
bindkey "^v" edit-command-line
|
bindkey "^v" edit-command-line
|
||||||
|
|
||||||
|
bindkey -s "^w" "work^M"
|
||||||
|
|
||||||
|
# adding cargo to path
|
||||||
|
export PATH=$HOME/.cargo/bin:$PATH
|
||||||
|
|
||||||
|
# adding local to path
|
||||||
|
export PATH=$HOME/.local/bin:$PATH
|
||||||
|
|
||||||
|
|
||||||
# >>> conda initialize >>>
|
export NVM_DIR="$HOME/.nvm"
|
||||||
# !! Contents within this block are managed by 'conda init' !!
|
#[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||||
__conda_setup="$('/home/andrei/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
|
nvm() {
|
||||||
if [ $? -eq 0 ]; then
|
unset -f nvm
|
||||||
eval "$__conda_setup"
|
export NVM_DIR=~/.nvm
|
||||||
else
|
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
|
||||||
if [ -f "/home/andrei/miniconda3/etc/profile.d/conda.sh" ]; then
|
nvm "$@"
|
||||||
. "/home/andrei/miniconda3/etc/profile.d/conda.sh"
|
|
||||||
else
|
|
||||||
export PATH="/home/andrei/miniconda3/bin:$PATH"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
unset __conda_setup
|
|
||||||
# <<< conda initialize <<<
|
|
||||||
|
|
||||||
|
|
||||||
# Open work folder with fuzzy finder
|
|
||||||
function work() {
|
|
||||||
work_dirs=( "$HOME/clones" "$HOME/sandbox" )
|
|
||||||
|
|
||||||
projects=()
|
|
||||||
|
|
||||||
for dr in "${work_dirs[@]}"; do
|
|
||||||
p=$( ls -d -1 ${dr}/* )
|
|
||||||
projects=( "${projects[@]}" "${p[@]}" )
|
|
||||||
done
|
|
||||||
|
|
||||||
goto=$(echo "$projects" | fzf --preview "tree -C -L 2 {}")
|
|
||||||
tmux new -A -s "$(basename -- $goto)" -c "$goto"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# new fzf command integration
|
||||||
|
source <(fzf --zsh)
|
||||||
|
|||||||
Reference in New Issue
Block a user