From d2a7a8263c0aa4929f281d20fda6c31283a47372 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Wed, 11 May 2022 16:14:54 -0700 Subject: [PATCH] Fix fish settings and better telescope for nvim --- .config/fish/conf.d/virtualfish-loader.fish | 12 +++++++-- .i3/config | 4 +-- .vim/nvim.lua | 39 ++++++++++++++++++++++++----- .vimrc | 5 ++-- .zshrc | 19 ++------------ 5 files changed, 50 insertions(+), 29 deletions(-) diff --git a/.config/fish/conf.d/virtualfish-loader.fish b/.config/fish/conf.d/virtualfish-loader.fish index eee0754..562c018 100644 --- a/.config/fish/conf.d/virtualfish-loader.fish +++ b/.config/fish/conf.d/virtualfish-loader.fish @@ -1,4 +1,12 @@ set -g VIRTUALFISH_VERSION 2.5.4 set -g VIRTUALFISH_PYTHON_EXEC /bin/python -source /usr/lib/python3.10/site-packages/virtualfish/virtual.fish -emit virtualfish_did_setup_plugins \ No newline at end of file + +set vfpaths /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish /usr/lib/python3.10/site-packages/virtualfish/virtual.fish /usr/lib/python3.9/site-packages/virtualfish/virtual.fish + +for vfpath in vfpaths + if test -f $vfpath + source $vfpath + emit virtualfish_did_setup_plugins + break + end +end diff --git a/.i3/config b/.i3/config index badf175..0574562 100644 --- a/.i3/config +++ b/.i3/config @@ -236,5 +236,5 @@ bindsym $win+Shift+l exec "playerctl next" #} #exec --no-startup-id xfce4-panel --disable-wm-check #exec polybar HDMI1 -exec --no-startup-id nitrogen --restore -exec --no-startup-id picom -b --config ~/.compton.conf +#exec --no-startup-id nitrogen --restore +#exec --no-startup-id picom -b --config ~/.compton.conf diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 4cf53a6..5d719d2 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -247,11 +247,17 @@ require('trouble').setup { }, } +local trouble_telescope = require("trouble.providers.telescope") + require('telescope').setup { defaults = { mappings = { n = { ["q"] = require('telescope.actions').close, + [""] = trouble_telescope.open_with_trouble, + }, + i = { + [""] = trouble_telescope.open_with_trouble, }, }, }, @@ -293,6 +299,11 @@ local dropdown = require'telescope.themes'.get_dropdown({ --winblend = 10 }) +local telescope_ivy = require'telescope.themes'.get_ivy({ + +}) + + -- -- Treesitter -- @@ -377,22 +388,38 @@ require"neogen".setup {} live_grep_repo = function(conf) --local opt = dropdown - local opt = { - cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] - } + local opt = telescope_ivy + opt['cwd'] = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + --local opt = { + --cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + --} for k,v in pairs(conf) do opt[k] = v end builtin.live_grep(opt) end git_grep_word = function(conf) --local opt = dropdown - local opt = { - cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] - } + local opt = telescope_ivy + opt['cwd'] = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + --local opt = { + --cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + --} for k,v in pairs(conf) do opt[k] = v end builtin.grep_string(opt) end +buffer_telescope = function(conf) + local opt = telescope_ivy + for k,v in pairs(conf) do opt[k] = v end + builtin.buffers(opt) +end + +file_list = function(conf) + local opt = telescope_ivy + for k,v in pairs(conf) do opt[k] = v end + builtin.git_files(opt) +end + --- --- My own "where" clause generator for Rust diff --git a/.vimrc b/.vimrc index 2720533..99192a6 100644 --- a/.vimrc +++ b/.vimrc @@ -992,7 +992,7 @@ nnoremap aa :RgRoot! "nnoremap aw :RgRoot! "nnoremap :Files! `git rev-parse --show-toplevel` "nnoremap :GFiles -nnoremap lua require('telescope.builtin').git_files() +nnoremap lua file_list{} nnoremap ag lua live_grep_repo{ word_match = "-w", only_sort_text = true, search = ''} nnoremap aw lua git_grep_word{ word_match = "-w", only_sort_text = true, initial_mode = "normal" } @@ -1001,7 +1001,8 @@ nnoremap aw lua git_grep_word{ word_match = "-w", only_sor nnoremap hh :A " CommandT is useful, but if I'm juggling lots of buffers, limit it to another " one I have open (instead of standard t). -nnoremap o :Buffers +"nnoremap o :Buffers +nnoremap o lua buffer_telescope{initial_mode = "normal"} "nnoremap j "nnoremap p :PTW nnoremap p :LustyJugglePrevious diff --git a/.zshrc b/.zshrc index 9b662af..2add78b 100644 --- a/.zshrc +++ b/.zshrc @@ -56,23 +56,6 @@ for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do done PR_NO_COLOUR="%{$terminfo[sgr0]%}" - ### - # Decide whether to set a screen title -# if [[ "$TERM" == "screen" ]]; then -# PR_STITLE=$'%{\ekzsh\e\\%}' -# else -# PR_STITLE='' -# fi - -# preexec () { -# local CMD="${1/#sudo /#}" -# local CMD="${CMD/#nano /}" -# local CMD="${CMD/#ssh />}" -# $SCREENME true || echo -ne "\ek${CMD%% *}\e\\" -# } - #precmd () { - #$SCREENME true || echo -ne "\ekzsh\e\\" - #} case `uname` in Darwin) PR_HOST_COLOR=$PR_CYAN @@ -181,6 +164,8 @@ if [ -f '/home/barak/local/google-cloud-sdk/path.zsh.inc' ]; then source '/home/ # The next line enables shell command completion for gcloud. if [ -f '/home/barak/local/google-cloud-sdk/completion.zsh.inc' ]; then source '/home/barak/local/google-cloud-sdk/completion.zsh.inc'; fi +if [ -f '/usr/local/lib/bazel/bin/_bazel' ]; then source '/usr/local/lib/bazel/bin/_bazel'; fi + # This enables autocomplete for kubectl if [ $commands[kubectl] ]; then source <(kubectl completion zsh)