From fb8f30fdb85a59194ee398bbd6b4224eaeadd3dc Mon Sep 17 00:00:00 2001 From: Andrei Stoica Date: Wed, 7 Jun 2023 04:26:34 -0400 Subject: [PATCH 1/3] nvchad rust --- .nvchad-custom/chadrc.lua | 4 ++++ .nvchad-custom/configs/lspconfig.lua | 12 ++++++------ .nvchad-custom/configs/null-ls.lua | 4 +++- .nvchad-custom/mappings.lua | 2 -- .nvchad-custom/plugins.lua | 6 ++++++ 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.nvchad-custom/chadrc.lua b/.nvchad-custom/chadrc.lua index fcaee86..fe16c67 100644 --- a/.nvchad-custom/chadrc.lua +++ b/.nvchad-custom/chadrc.lua @@ -10,6 +10,10 @@ M.ui = { hl_override = highlights.override, hl_add = highlights.add, + tabufline = { + enabled = false, + }, + } M.plugins = "custom.plugins" diff --git a/.nvchad-custom/configs/lspconfig.lua b/.nvchad-custom/configs/lspconfig.lua index bd956f4..3cbf9ab 100644 --- a/.nvchad-custom/configs/lspconfig.lua +++ b/.nvchad-custom/configs/lspconfig.lua @@ -1,17 +1,17 @@ local on_attach = require("plugins.configs.lspconfig").on_attach local capabilities = require("plugins.configs.lspconfig").capabilities -local lspconfig = require "lspconfig" +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" } for _, lsp in ipairs(servers) do - lspconfig[lsp].setup { - on_attach = on_attach, - capabilities = capabilities, - } + lspconfig[lsp].setup({ + on_attach = on_attach, + capabilities = capabilities, + }) end -- diff --git a/.nvchad-custom/configs/null-ls.lua b/.nvchad-custom/configs/null-ls.lua index a3881e1..f364b11 100644 --- a/.nvchad-custom/configs/null-ls.lua +++ b/.nvchad-custom/configs/null-ls.lua @@ -20,12 +20,14 @@ local sources = { 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, } diff --git a/.nvchad-custom/mappings.lua b/.nvchad-custom/mappings.lua index df5f6db..4b7f48f 100644 --- a/.nvchad-custom/mappings.lua +++ b/.nvchad-custom/mappings.lua @@ -3,8 +3,6 @@ local M = {} M.general = { n = { - [";"] = { ":", "enter command mode", opts = { nowait = true } }, - -- harpoon ["H"] = {function() require("harpoon.ui").toggle_quick_menu() end, "Open Harpoon" }, ["a"] = {function() require("harpoon.mark").add_file() end, "Add file to Harpoon"}, diff --git a/.nvchad-custom/plugins.lua b/.nvchad-custom/plugins.lua index fb9cf8c..cde8ca6 100644 --- a/.nvchad-custom/plugins.lua +++ b/.nvchad-custom/plugins.lua @@ -58,6 +58,12 @@ local plugins = { "theprimeagen/harpoon", }, + { + 'simrat39/rust-tools.nvim' + }, + + -- Disable nvchad plugins + { "tpope/vim-sleuth", lazy = false, From 065569b23c2ef67e0985b9c058e3b56e31158c2c Mon Sep 17 00:00:00 2001 From: Andrei Stoica Date: Wed, 7 Jun 2023 04:27:23 -0400 Subject: [PATCH 2/3] broadcast bindings --- .tmux.conf##os.Linux,hostname.tower | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.tmux.conf##os.Linux,hostname.tower b/.tmux.conf##os.Linux,hostname.tower index 9aa94b5..1f35288 100644 --- a/.tmux.conf##os.Linux,hostname.tower +++ b/.tmux.conf##os.Linux,hostname.tower @@ -18,6 +18,12 @@ unbind '"' bind | split-window -h bind - split-window -v +# broadcast to panes +unbind b +unbind B +bind b setw synchronize-panes on +bind B setw synchronize-panes off + # status bar set -g status-right '%H:%m %d-%b-%y ' From 1f180f6618b8d23fcb99cc4fc169b44271863372 Mon Sep 17 00:00:00 2001 From: Andrei Stoica Date: Wed, 7 Jun 2023 04:28:40 -0400 Subject: [PATCH 3/3] added rust's cargo to path and updated work command --- .zshrc | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/.zshrc b/.zshrc index cdfba14..38caf0a 100644 --- a/.zshrc +++ b/.zshrc @@ -99,21 +99,8 @@ zle -N edit-command-line bindkey "^v" edit-command-line - -# >>> conda initialize >>> -# !! Contents within this block are managed by 'conda init' !! -__conda_setup="$('/home/andrei/miniconda3/bin/conda' 'shell.zsh' '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 <<< +# adding cargo to path +export PATH=$HOME/.cargo/bin:$PATH # Open work folder with fuzzy finder @@ -123,10 +110,16 @@ function work() { projects=() for dr in "${work_dirs[@]}"; do - p=$( ls -d -1 ${dr}/* ) - projects=( "${projects[@]}" "${p[@]}" ) + 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" + goto=$(echo "$projects" | fzf --query=$1 --preview "tree -C -L 2 {}") + 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 }