From 3d0d95a4bbf92b5159507d82e3de2b10201bf3df Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Mon, 10 Apr 2023 09:59:28 +0200 Subject: [PATCH] vim/nvim: update file/search cmd --- files/git/.gitconfig | 2 -- files/nvim/.config/nvim/lua/mappings.lua | 18 ++++-------------- files/vim/.vimrc | 24 ++++++------------------ 3 files changed, 10 insertions(+), 34 deletions(-) diff --git a/files/git/.gitconfig b/files/git/.gitconfig index f0a6402..9bd2446 100644 --- a/files/git/.gitconfig +++ b/files/git/.gitconfig @@ -25,5 +25,3 @@ coloring = highlightRecent [color "blame"] highlightRecent = 248, 23 month ago, 247, 21 month ago, 246, 19 month ago, 245, 17 month ago, 244, 15 month ago, 243, 13 month ago, 242, 11 month ago, 241, 9 month ago, 240, 8 month ago, 239, 7 month ago, 238, 6 month ago, 237, 5 month ago, 236, 4 month ago, 235, 3 month ago, 234, 2 month ago, 233, 1 month ago, 232, 1 week ago, 112 - - diff --git a/files/nvim/.config/nvim/lua/mappings.lua b/files/nvim/.config/nvim/lua/mappings.lua index 0d3522f..cd6ae6e 100644 --- a/files/nvim/.config/nvim/lua/mappings.lua +++ b/files/nvim/.config/nvim/lua/mappings.lua @@ -4,7 +4,7 @@ local default_opts = { noremap = true, silent = true } vim.g.mapleader = ' ' -map("n", "", " noh", default_opts) +-- map("n", "", " noh", default_opts) map("n", "", " messages", default_opts) -- Telescope @@ -24,9 +24,8 @@ telescope.setup({ } } }) -map("n", "", " Telescope git_files ", default_opts) -map("n", "", " Telescope find_files find_command=rg,--ignore,--hidden,--files", default_opts) -map("n", "", " Telescope live_grep previewer=false", default_opts) +map("n", "", " Telescope find_files find_command=rg,--ignore,--hidden,--files", default_opts) +map("n", "", " Telescope live_grep previewer=false", default_opts) map("n", "", " Telescope keymaps", default_opts) -- LSP @@ -91,16 +90,7 @@ wk.register({ -- Comment.nvim require('Comment').setup({ opleader = { - line = 'cl', - block = 'cb', - } -}) -wk.register({ - [""] = { - c = { - l = { "Line comment" }, - b = { "Block comment" }, - } + line = '', } }) diff --git a/files/vim/.vimrc b/files/vim/.vimrc index 046719d..eccf40c 100644 --- a/files/vim/.vimrc +++ b/files/vim/.vimrc @@ -1,6 +1,6 @@ " ~/.vimrc " - " ~ M. Thomas +" ~ M. Thomas let mapleader = "\" @@ -108,27 +108,15 @@ let g:netrw_liststyle = 3 " Tree-like structure let g:netrw_banner = 0 " Remove useless banner at the top of netrw " ============================== Macros and Mappings -" fzf -map :Files -map :GFiles +" file interaction +let g:fzf_preview_window = ['down,50%', 'ctrl-/'] command! -bang -nargs=* GGrep \ call fzf#vim#grep( \ 'git grep --line-number -- '.shellescape(), 0, - \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), 0) + \ fzf#vim#with_preview(), 0) -let rgcheck = system("which rg 2> /dev/null") -if v:shell_error == 0 - map :Rg -else - map :GGrep -endif - -" git -map gs :Git status -map gb :Git blame - -" other -map :noh +map :Files +map :GGrep fun! TrimWhitespace() let l:save = winsaveview()