update nvim telescope config

This commit is contained in:
Barak Michener 2023-05-23 15:58:24 -07:00
parent d784acc82a
commit e94b86c137
5 changed files with 40 additions and 56 deletions

View file

@ -1,4 +1,4 @@
set -g VIRTUALFISH_VERSION 2.5.5
set -g VIRTUALFISH_PYTHON_EXEC /usr/bin/python
source /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish
emit virtualfish_did_setup_plugins
#set -g VIRTUALFISH_VERSION 2.5.5
#set -g VIRTUALFISH_PYTHON_EXEC /usr/bin/python
#source /usr/local/lib/python3.10/site-packages/virtualfish/virtual.fish
emit virtualfish_did_setup_plugins

View file

@ -4,7 +4,7 @@ Name=Spotify
GenericName=Online music streaming service
Comment=Access all of your favorite music
Icon=com.spotify.Client
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client --force-device-scale-factor=1.3 @@u %U @@
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client --force-device-scale-factor=2 @@u %U @@
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;AudioVideo;

View file

@ -15,6 +15,8 @@ bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-n next-window
bind -n M-p previous-window
bind-key C-n next-window
bind-key C-p previous-window
set -g set-titles off
@ -32,11 +34,12 @@ bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# better mnemonics for splitting panes!
bind | split-window -h
bind - split-window -v
#bind | split-window -h
#bind - split-window -v
bind v split-window -h
bind = select-layout even-horizontal
bind | select-layout main-vertical
bind-key C-t new-window "ttyd -R -d -t fontSize=18 tmux attach -t `tmux display -p '#S'`"
# Status Bar
@ -47,6 +50,7 @@ set -g status-interval 1
#set -g status-right '#[fg=green]#(~/src/tpom/tpom) #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]'
set -g status-justify centre # center align window list
set -g status-style fg=white,bg=default
set -g main-pane-width 68%
# default window title colors
set-window-option -g window-status-style fg=white,bg=default,dim

View file

@ -324,6 +324,30 @@ require('telescope').setup {
layout_config = {
height = 15,
},
initial_mode = "normal",
},
git_files = {
theme = "ivy",
},
grep_string = {
theme = "ivy",
layout_config = {
height = 15,
},
initial_mode = "normal",
},
live_grep = {
theme = "ivy",
layout_config = {
height = 15,
},
},
buffers = {
theme = "ivy",
layout_config = {
height = 15,
},
initial_mode = "normal",
},
},
}
@ -427,50 +451,6 @@ require "neogen".setup {}
require('leap').set_default_keymaps()
require("flit").setup {}
--
-- Helper functions for my own grepping commands.
--
live_grep_repo = function(conf)
--local opt = dropdown
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 = 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
--quickfix_telescope = function(conf)
--local opt = telescope_ivy
--for k, v in pairs(conf) do opt[k] = v end
--builtin.quickfix(opt)
--end
---
--- My own "where" clause generator for Rust

10
.vimrc
View file

@ -1013,10 +1013,10 @@ nnoremap <silent> <Leader>aa :<C-u>RgRoot!<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-k> :<C-u>GFiles<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>aw <cmd>lua git_grep_word{ word_match = "-w", only_sort_text = true, initial_mode = "normal" }<cr>
nnoremap <silent> <Leader>q <cmd>lua require('telescope.builtin').quickfix{ initial_mode = "normal" }<cr>
nnoremap <silent> <C-k> <cmd>lua require('telescope.builtin').git_files{}<cr>
nnoremap <silent> <Leader>ag <cmd>lua require('telescope.builtin').live_grep{ word_match = "-w", only_sort_text = true, cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1], search = ''}<cr>
nnoremap <silent> <Leader>aw <cmd>lua require('telescope.builtin').grep_string{ word_match = "-w", only_sort_text = true, cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1]}<cr>
nnoremap <silent> <Leader>q <cmd>lua require('telescope.builtin').quickfix{}<cr>
" For C++ -- A is a great plugin which allows you to jump from the c file to the
" header and vice-versa. Mneumonic here is headerheader.
@ -1024,7 +1024,7 @@ nnoremap <Leader>hh :A<CR>
" CommandT is useful, but if I'm juggling lots of buffers, limit it to another
" one I have open (instead of standard <Leader>t).
"nnoremap <silent> <Leader>o :<C-u>Buffers<CR>
nnoremap <silent> <Leader>o <cmd>lua buffer_telescope{initial_mode = "normal"}<cr>
nnoremap <silent> <Leader>o <cmd>lua require('telescope.builtin').buffers{}<cr>
"nnoremap <Leader>j <C-^>
"nnoremap <Leader>p :PTW
nnoremap <Leader>p :LustyJugglePrevious<CR>