Compare commits

..

3 Commits

Author SHA1 Message Date
Andrei Stoica 5c88830f93 manual merge 2024-01-24 14:34:32 -05:00
Andrei Stoica 0ab89f02ba wip 2024-01-24 14:30:44 -05:00
Andrei Stoica 8639ac6164 alias 2024-01-22 14:41:41 -05:00
9 changed files with 130 additions and 31 deletions

View File

@ -41,3 +41,5 @@ alias venv='python -m venv'
alias venv2='python2 -m venv'
alias venv3='python3 -m venv'
alias dotvenv='source .venv/bin/activate'
alias todo='rusty-tasks'
alias ccat='highlight -O ansi --force'

16
.bashrc
View File

@ -141,18 +141,4 @@ TERM=xterm-256color
export VISUAL=vim
export EDITOR="$VISUAL"
# >>> conda initialize >>>
# !! 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 <<<
. "$HOME/.cargo/env"

View File

@ -5,8 +5,8 @@ local M = {}
local highlights = require "custom.highlights"
M.ui = {
theme = "tokyodark",
theme_toggle = { "tokyodark", "one_light" },
theme = "onedark",
theme_toggle = { "onedark", "one_light" },
hl_override = highlights.override,
hl_add = highlights.add,

View File

@ -5,7 +5,7 @@ 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" }
{ "html", "cssls", "tsserver", "clangd", "docker_compose_language_service", "dockerls", "rust_analyzer", "pyright", "grammarly" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup({

View File

@ -41,6 +41,7 @@ M.mason = {
"jedi_language_server",
"docker_compose_language_service",
"dockerls",
},
@ -62,4 +63,58 @@ M.nvimtree = {
},
}
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

View File

@ -5,11 +5,11 @@ M.general = {
n = {
-- harpoon
["H"] = {function() require("harpoon.ui").toggle_quick_menu() end, "Open Harpoon" },
["<leader>a"] = {function() require("harpoon.mark").add_file() end, "Add file to Harpoon"},
["<leader>s"] = {function() require("harpoon.ui").nav_file(1) end, "Switch to file 1"},
["<leader>d"] = {function() require("harpoon.ui").nav_file(2) end, "Switch to file 2"},
["<leader>f"] = {function() require("harpoon.ui").nav_file(3) end, "Switch to file 3"},
["<leader>g"] = {function() require("harpoon.ui").nav_file(4) end, "Switch to file 4"},
["<leader>ha"] = {function() require("harpoon.mark").add_file() end, "Add file to Harpoon"},
["<leader>hs"] = {function() require("harpoon.ui").nav_file(1) end, "Switch to file 1"},
["<leader>hd"] = {function() require("harpoon.ui").nav_file(2) end, "Switch to file 2"},
["<leader>hf"] = {function() require("harpoon.ui").nav_file(3) end, "Switch to file 3"},
["<leader>hg"] = {function() require("harpoon.ui").nav_file(4) end, "Switch to file 4"},
-- navigation
["<C-d>"] = {"<C-d>zz", "1/2 page down"},
@ -17,7 +17,6 @@ M.general = {
["n"] = {"nzz", "find next"},
["N"] = {"Nzz", "find prev"},
},
}

View File

@ -1,10 +1,16 @@
local overrides = require "custom.configs.overrides"
---@type NvPluginSpec[]
local plugins = {
-- Override plugin definition options
{
"hrsh7th/nvim-cmp",
opts = overrides.cmp
},
{
"neovim/nvim-lspconfig",
dependencies = {
@ -54,13 +60,24 @@ local plugins = {
end,
},
{ "nvim-treesitter/nvim-treesitter-context",
lazy = false,
},
{
"theprimeagen/harpoon",
},
{
'simrat39/rust-tools.nvim'
},
{
'simrat39/rust-tools.nvim'
},
{
"ellisonleao/glow.nvim",
config = true,
cmd = "Glow",
event = 'BufEnter *.md',
},
-- Disable nvchad plugins
@ -69,7 +86,6 @@ local plugins = {
lazy = false,
},
{ "NvChad/nvterm", enabled = false },
-- To make a plugin not be loaded

View File

@ -25,6 +25,10 @@ bind b setw synchronize-panes
# setting vi mode
set-window-option -g mode-keys vi
# reset working dir for session
unbind h
bind h attach-session -t . -c "#{pane_current_path}"
# status bar
set -g status-right '♥#(acpi | cut -d ',' -f 2) | %H:%m %d-%b-%y '

43
.zshrc
View File

@ -107,15 +107,52 @@ 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
[ -z $goto ] && return
if [ -z $TMUX ]
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
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