From 6b70e64f84816dffe68825d5a4e797e21461bd4e Mon Sep 17 00:00:00 2001 From: Kalle Struik Date: Thu, 13 Oct 2022 17:58:48 +0200 Subject: [PATCH] Make proj use the new project command line tool --- bash/.bashrc | 9 +++++---- nvim/lua/kalle/config/plugin-config/lsp.lua | 2 +- scripts/proj_preview | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100755 scripts/proj_preview diff --git a/bash/.bashrc b/bash/.bashrc index 77fd228..1a957ae 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -3,13 +3,14 @@ [[ $- != *i* ]] && return # Add ~/bin and ~/bin/scripts to my path -export PATH=$PATH:$HOME/bin/:$HOME/bin/scripts/ +export PATH=$PATH:$HOME/bin/:$HOME/bin/scripts/:$HOME/.cargo/bin NEOVIDE_COMMAND="env WINIT_UNIX_BACKEND=x11 neovide --multigrid" # Set editor to neovim. alias neovide=$NEOVIDE_COMMAND -export EDITOR=$NEOVIDE_COMMAND +alias edit=$NEOVIDE_COMMAND +export EDITOR="$NEOVIDE_COMMAND --nofork" # Prompt stuff # @@ -123,8 +124,8 @@ function cdl() { # Functions function cd-projects { - dir=$(find ~/Projects -maxdepth 3 -type d | fzf) - cd "$dir" + project_name=`project list | fzf --preview="proj_preview {}"` + cd "`project path "$project_name"`" } # Aliases diff --git a/nvim/lua/kalle/config/plugin-config/lsp.lua b/nvim/lua/kalle/config/plugin-config/lsp.lua index cf3672a..3273897 100644 --- a/nvim/lua/kalle/config/plugin-config/lsp.lua +++ b/nvim/lua/kalle/config/plugin-config/lsp.lua @@ -53,7 +53,7 @@ local rt_config = { }, } -require('rust-tools').setup(rt_config) +require('rust-tools').setup() -- LSP Diagnostics Options Setup local sign = function(opts) diff --git a/scripts/proj_preview b/scripts/proj_preview new file mode 100755 index 0000000..63f8ad1 --- /dev/null +++ b/scripts/proj_preview @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +bat -pf `project path "$1"`/README.md