From e94b86c137a51568819eea4e9c840f7818a3474f Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Tue, 23 May 2023 15:58:24 -0700 Subject: [PATCH] update nvim telescope config --- .config/fish/conf.d/virtualfish-loader.fish | 8 +-- .../share/applications/com.spotify.Client.desktop | 2 +- .tmux.conf | 8 ++- .vim/nvim.lua | 68 ++++++++-------------- .vimrc | 10 ++-- 5 files changed, 40 insertions(+), 56 deletions(-) diff --git a/.config/fish/conf.d/virtualfish-loader.fish b/.config/fish/conf.d/virtualfish-loader.fish index c0790b2..e306e12 100644 --- a/.config/fish/conf.d/virtualfish-loader.fish +++ b/.config/fish/conf.d/virtualfish-loader.fish @@ -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 \ No newline at end of file +#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 diff --git a/.local/share/applications/com.spotify.Client.desktop b/.local/share/applications/com.spotify.Client.desktop index bd0a8d4..f2f9fc4 100755 --- a/.local/share/applications/com.spotify.Client.desktop +++ b/.local/share/applications/com.spotify.Client.desktop @@ -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; diff --git a/.tmux.conf b/.tmux.conf index be04e79..3c76fe2 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -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 diff --git a/.vim/nvim.lua b/.vim/nvim.lua index e1bb878..c1b73b3 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -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 diff --git a/.vimrc b/.vimrc index d34bebb..8448196 100644 --- a/.vimrc +++ b/.vimrc @@ -1013,10 +1013,10 @@ nnoremap aa :RgRoot! "nnoremap aw :RgRoot! "nnoremap :Files! `git rev-parse --show-toplevel` "nnoremap :GFiles -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" } -nnoremap q lua require('telescope.builtin').quickfix{ initial_mode = "normal" } +nnoremap lua require('telescope.builtin').git_files{} +nnoremap ag lua require('telescope.builtin').live_grep{ word_match = "-w", only_sort_text = true, cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1], search = ''} +nnoremap aw lua require('telescope.builtin').grep_string{ word_match = "-w", only_sort_text = true, cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1]} +nnoremap q lua require('telescope.builtin').quickfix{} " 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 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 lua buffer_telescope{initial_mode = "normal"} +nnoremap o lua require('telescope.builtin').buffers{} "nnoremap j "nnoremap p :PTW nnoremap p :LustyJugglePrevious