Fix fish settings and better telescope for nvim

This commit is contained in:
Barak Michener 2022-05-11 16:14:54 -07:00
parent 96685eb902
commit d2a7a8263c
5 changed files with 50 additions and 29 deletions

View file

@ -1,4 +1,12 @@
set -g VIRTUALFISH_VERSION 2.5.4 set -g VIRTUALFISH_VERSION 2.5.4
set -g VIRTUALFISH_PYTHON_EXEC /bin/python set -g VIRTUALFISH_PYTHON_EXEC /bin/python
source /usr/lib/python3.10/site-packages/virtualfish/virtual.fish
emit virtualfish_did_setup_plugins 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

View file

@ -236,5 +236,5 @@ bindsym $win+Shift+l exec "playerctl next"
#} #}
#exec --no-startup-id xfce4-panel --disable-wm-check #exec --no-startup-id xfce4-panel --disable-wm-check
#exec polybar HDMI1 #exec polybar HDMI1
exec --no-startup-id nitrogen --restore #exec --no-startup-id nitrogen --restore
exec --no-startup-id picom -b --config ~/.compton.conf #exec --no-startup-id picom -b --config ~/.compton.conf

View file

@ -247,11 +247,17 @@ require('trouble').setup {
}, },
} }
local trouble_telescope = require("trouble.providers.telescope")
require('telescope').setup { require('telescope').setup {
defaults = { defaults = {
mappings = { mappings = {
n = { n = {
["q"] = require('telescope.actions').close, ["q"] = require('telescope.actions').close,
["<c-t>"] = trouble_telescope.open_with_trouble,
},
i = {
["<c-t>"] = trouble_telescope.open_with_trouble,
}, },
}, },
}, },
@ -293,6 +299,11 @@ local dropdown = require'telescope.themes'.get_dropdown({
--winblend = 10 --winblend = 10
}) })
local telescope_ivy = require'telescope.themes'.get_ivy({
})
-- --
-- Treesitter -- Treesitter
-- --
@ -377,22 +388,38 @@ require"neogen".setup {}
live_grep_repo = function(conf) live_grep_repo = function(conf)
--local opt = dropdown --local opt = dropdown
local opt = { local opt = telescope_ivy
cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] 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 for k,v in pairs(conf) do opt[k] = v end
builtin.live_grep(opt) builtin.live_grep(opt)
end end
git_grep_word = function(conf) git_grep_word = function(conf)
--local opt = dropdown --local opt = dropdown
local opt = { local opt = telescope_ivy
cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] 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 for k,v in pairs(conf) do opt[k] = v end
builtin.grep_string(opt) builtin.grep_string(opt)
end 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 --- My own "where" clause generator for Rust

5
.vimrc
View file

@ -992,7 +992,7 @@ nnoremap <silent> <Leader>aa :<C-u>RgRoot!<CR>
"nnoremap <silent> <Leader>aw :<C-u>RgRoot! <C-r><C-w><CR> "nnoremap <silent> <Leader>aw :<C-u>RgRoot! <C-r><C-w><CR>
"nnoremap <C-l> :<C-u>Files! `git rev-parse --show-toplevel`<CR> "nnoremap <C-l> :<C-u>Files! `git rev-parse --show-toplevel`<CR>
"nnoremap <C-k> :<C-u>GFiles<CR> "nnoremap <C-k> :<C-u>GFiles<CR>
nnoremap <C-k> <cmd>lua require('telescope.builtin').git_files()<cr> nnoremap <silent> <C-k> <cmd>lua file_list{}<cr>
nnoremap <silent> <Leader>ag <cmd>lua live_grep_repo{ word_match = "-w", only_sort_text = true, search = ''}<cr> nnoremap <silent> <Leader>ag <cmd>lua live_grep_repo{ word_match = "-w", only_sort_text = true, search = ''}<cr>
nnoremap <silent> <Leader>aw <cmd>lua git_grep_word{ word_match = "-w", only_sort_text = true, initial_mode = "normal" }<cr> nnoremap <silent> <Leader>aw <cmd>lua git_grep_word{ word_match = "-w", only_sort_text = true, initial_mode = "normal" }<cr>
@ -1001,7 +1001,8 @@ nnoremap <silent> <Leader>aw <cmd>lua git_grep_word{ word_match = "-w", only_sor
nnoremap <Leader>hh :A<CR> nnoremap <Leader>hh :A<CR>
" CommandT is useful, but if I'm juggling lots of buffers, limit it to another " CommandT is useful, but if I'm juggling lots of buffers, limit it to another
" one I have open (instead of standard <Leader>t). " one I have open (instead of standard <Leader>t).
nnoremap <silent> <Leader>o :<C-u>Buffers<CR> "nnoremap <silent> <Leader>o :<C-u>Buffers<CR>
nnoremap <silent> <Leader>o <cmd>lua buffer_telescope{initial_mode = "normal"}<cr>
"nnoremap <Leader>j <C-^> "nnoremap <Leader>j <C-^>
"nnoremap <Leader>p :PTW "nnoremap <Leader>p :PTW
nnoremap <Leader>p :LustyJugglePrevious<CR> nnoremap <Leader>p :LustyJugglePrevious<CR>

19
.zshrc
View file

@ -56,23 +56,6 @@ for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
done done
PR_NO_COLOUR="%{$terminfo[sgr0]%}" 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 case `uname` in
Darwin) Darwin)
PR_HOST_COLOR=$PR_CYAN 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. # 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 '/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 # This enables autocomplete for kubectl
if [ $commands[kubectl] ]; then if [ $commands[kubectl] ]; then
source <(kubectl completion zsh) source <(kubectl completion zsh)