vim/nvim: update file/search cmd
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ local default_opts = { noremap = true, silent = true }
|
||||
|
||||
vim.g.mapleader = ' '
|
||||
|
||||
map("n", "<C-_>", "<cmd> noh<CR>", default_opts)
|
||||
-- map("n", "<C-_>", "<cmd> noh<CR>", default_opts)
|
||||
map("n", "<C-m>", "<cmd> messages<CR>", default_opts)
|
||||
|
||||
-- Telescope
|
||||
@@ -24,9 +24,8 @@ telescope.setup({
|
||||
}
|
||||
}
|
||||
})
|
||||
map("n", "<C-g>", "<cmd> Telescope git_files <CR>", default_opts)
|
||||
map("n", "<C-f>", "<cmd> Telescope find_files find_command=rg,--ignore,--hidden,--files<CR>", default_opts)
|
||||
map("n", "<C-s>", "<cmd> Telescope live_grep previewer=false<CR>", default_opts)
|
||||
map("n", "<C-p>", "<cmd> Telescope find_files find_command=rg,--ignore,--hidden,--files<CR>", default_opts)
|
||||
map("n", "<C-f>", "<cmd> Telescope live_grep previewer=false<CR>", default_opts)
|
||||
map("n", "<C-k>", "<cmd> Telescope keymaps<CR>", default_opts)
|
||||
|
||||
-- LSP
|
||||
@@ -91,16 +90,7 @@ wk.register({
|
||||
-- Comment.nvim
|
||||
require('Comment').setup({
|
||||
opleader = {
|
||||
line = '<leader>cl',
|
||||
block = '<leader>cb',
|
||||
}
|
||||
})
|
||||
wk.register({
|
||||
["<leader>"] = {
|
||||
c = {
|
||||
l = { "Line comment" },
|
||||
b = { "Block comment" },
|
||||
}
|
||||
line = '<C-_>',
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" ~/.vimrc
|
||||
"
|
||||
" ~ M. Thomas
|
||||
" ~ M. Thomas
|
||||
|
||||
let mapleader = "\<Space>"
|
||||
|
||||
@@ -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 <C-f> :Files<CR>
|
||||
map <C-g> :GFiles<CR>
|
||||
" file interaction
|
||||
let g:fzf_preview_window = ['down,50%', 'ctrl-/']
|
||||
command! -bang -nargs=* GGrep
|
||||
\ call fzf#vim#grep(
|
||||
\ 'git grep --line-number -- '.shellescape(<q-args>), 0,
|
||||
\ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0)
|
||||
\ fzf#vim#with_preview(), <bang>0)
|
||||
|
||||
let rgcheck = system("which rg 2> /dev/null")
|
||||
if v:shell_error == 0
|
||||
map <C-s> :Rg<CR>
|
||||
else
|
||||
map <C-s> :GGrep<CR>
|
||||
endif
|
||||
|
||||
" git
|
||||
map <leader>gs :Git status<CR>
|
||||
map <leader>gb :Git blame<CR>
|
||||
|
||||
" other
|
||||
map <C-_> :noh<CR>
|
||||
map <C-p> :Files<CR>
|
||||
map <C-f> :GGrep
|
||||
|
||||
fun! TrimWhitespace()
|
||||
let l:save = winsaveview()
|
||||
|
||||
Reference in New Issue
Block a user