Compare commits
12 Commits
1cc9378eca
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 42b683b62b | |||
| 30e7cf3d02 | |||
| b0296177f6 | |||
| d1c391a7ec | |||
| ca37a74180 | |||
| 19f6c5d5d2 | |||
| 550866878e | |||
| 434d371c57 | |||
| d509b8a159 | |||
| 446ec92655 | |||
| 805f2d06bb | |||
| 801d97d217 |
27
.aliases
27
.aliases
@@ -1,7 +1,29 @@
|
||||
# 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 -;};
|
||||
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'
|
||||
@@ -29,3 +51,4 @@ alias dotvenv='source .venv/bin/activate'
|
||||
alias todo='rusty-tasks'
|
||||
alias ccat='bat'
|
||||
alias we='watchexec'
|
||||
alias netcheck='ping 8.8.8.8'
|
||||
|
||||
1
.config/nvim
Submodule
1
.config/nvim
Submodule
Submodule .config/nvim added at a54d69c808
@@ -13,7 +13,7 @@
|
||||
d = diff
|
||||
dc = diff -cached
|
||||
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]
|
||||
editor = nvim
|
||||
@@ -26,3 +26,5 @@
|
||||
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
|
||||
@@ -14,6 +14,7 @@ local servers = {
|
||||
"rust_analyzer",
|
||||
"pyright",
|
||||
"grammarly",
|
||||
"marksman",
|
||||
}
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
@@ -29,5 +30,3 @@ lspconfig["clangd"].setup({
|
||||
offsetEncoding = { "utf-16" },
|
||||
},
|
||||
})
|
||||
--
|
||||
-- lspconfig.pyright.setup { blabla}
|
||||
|
||||
@@ -2,17 +2,28 @@ local M = {}
|
||||
|
||||
M.treesitter = {
|
||||
ensure_installed = {
|
||||
"vim",
|
||||
"lua",
|
||||
"html",
|
||||
"css",
|
||||
"javascript",
|
||||
"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,
|
||||
@@ -41,7 +52,6 @@ M.mason = {
|
||||
|
||||
"jedi_language_server",
|
||||
|
||||
|
||||
"docker_compose_language_service",
|
||||
"dockerls",
|
||||
},
|
||||
@@ -63,8 +73,8 @@ M.nvimtree = {
|
||||
},
|
||||
}
|
||||
|
||||
M.cmp = function (_, opts)
|
||||
local cmp = require "cmp"
|
||||
M.cmp = function(_, opts)
|
||||
local cmp = require("cmp")
|
||||
opts.experimental = {
|
||||
ghost_text = true,
|
||||
}
|
||||
@@ -73,20 +83,20 @@ M.cmp = function (_, opts)
|
||||
{ name = "luasnip" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "path" },
|
||||
{ name = "buffer", keyword_length = 5},
|
||||
{ name = "buffer", keyword_length = 5 },
|
||||
})
|
||||
|
||||
opts.mapping = cmp.config.mapping {
|
||||
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 {
|
||||
["<C-y>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
},
|
||||
}),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
@@ -111,10 +121,8 @@ M.cmp = function (_, opts)
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
}
|
||||
})
|
||||
return opts
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -47,6 +47,22 @@ local plugins = {
|
||||
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
|
||||
{
|
||||
@@ -113,25 +129,26 @@ local plugins = {
|
||||
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
|
||||
{
|
||||
"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" },
|
||||
@@ -142,7 +159,43 @@ local plugins = {
|
||||
-- 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
|
||||
|
||||
{
|
||||
|
||||
@@ -47,10 +47,10 @@ set-option -g renumber-windows on
|
||||
# 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 -r 'C-h' if-shell "${is_vim}" 'send-keys C-h' 'select-pane -L'
|
||||
bind-key -n -r 'C-j' if-shell "${is_vim}" 'send-keys C-j' 'select-pane -D'
|
||||
bind-key -n -r 'C-k' if-shell "${is_vim}" 'send-keys C-k' 'select-pane -U'
|
||||
bind-key -n -r 'C-l' if-shell "${is_vim}" 'send-keys C-l' 'select-pane -R'
|
||||
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 ]' \
|
||||
|
||||
61
.zshrc
61
.zshrc
@@ -1,3 +1,4 @@
|
||||
zmodload zsh/zprof
|
||||
# If you come from bash you might have to change your $PATH.
|
||||
export PATH=$HOME/bin:/usr/local/bin:/usr/lib65/openjdk-17/bin:$PATH
|
||||
|
||||
@@ -59,7 +60,6 @@ ZSH_THEME="blokkzh"
|
||||
# Add wisely, as too many plugins slow down shell startup.
|
||||
plugins=(
|
||||
git
|
||||
zsh-fzf-history-search
|
||||
)
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
@@ -102,6 +102,7 @@ autoload -z edit-command-line
|
||||
zle -N edit-command-line
|
||||
bindkey "^v" edit-command-line
|
||||
|
||||
bindkey -s "^w" "work^M"
|
||||
|
||||
# adding cargo to path
|
||||
export PATH=$HOME/.cargo/bin:$PATH
|
||||
@@ -109,53 +110,15 @@ export PATH=$HOME/.cargo/bin:$PATH
|
||||
# adding local to path
|
||||
export PATH=$HOME/.local/bin:$PATH
|
||||
|
||||
# Open work folder with fuzzy finder
|
||||
function work() {
|
||||
work_dirs=( "$HOME/clones" "$HOME/sandbox" )
|
||||
|
||||
goto=$(find $work_dirs -maxdepth 1 -mindepth 1 -type d | fzf --query=$1 --preview "tree -C -L 2 {}")
|
||||
[ -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)"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# JINA_CLI_BEGIN
|
||||
|
||||
## autocomplete
|
||||
if [[ ! -o interactive ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
compctl -K _jina jina
|
||||
|
||||
_jina() {
|
||||
local words completions
|
||||
read -cA words
|
||||
|
||||
if [ "${#words}" -eq 2 ]; then
|
||||
completions="$(jina commands)"
|
||||
else
|
||||
completions="$(jina completions ${words[2,-2]})"
|
||||
fi
|
||||
|
||||
reply=(${(ps:
|
||||
:)completions})
|
||||
}
|
||||
|
||||
# session-wise fix
|
||||
ulimit -n 4096
|
||||
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
|
||||
|
||||
# JINA_CLI_END
|
||||
|
||||
|
||||
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
|
||||
#[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
nvm() {
|
||||
unset -f nvm
|
||||
export NVM_DIR=~/.nvm
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
nvm "$@"
|
||||
}
|
||||
|
||||
# new fzf command integration
|
||||
source <(fzf --zsh)
|
||||
|
||||
Reference in New Issue
Block a user