vim/nvim: update file/search cmd
This commit is contained in:
@@ -25,5 +25,3 @@
|
|||||||
coloring = highlightRecent
|
coloring = highlightRecent
|
||||||
[color "blame"]
|
[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
|
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 = ' '
|
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)
|
map("n", "<C-m>", "<cmd> messages<CR>", default_opts)
|
||||||
|
|
||||||
-- Telescope
|
-- Telescope
|
||||||
@@ -24,9 +24,8 @@ telescope.setup({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
map("n", "<C-g>", "<cmd> Telescope git_files <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 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-s>", "<cmd> Telescope live_grep previewer=false<CR>", default_opts)
|
|
||||||
map("n", "<C-k>", "<cmd> Telescope keymaps<CR>", default_opts)
|
map("n", "<C-k>", "<cmd> Telescope keymaps<CR>", default_opts)
|
||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
@@ -91,16 +90,7 @@ wk.register({
|
|||||||
-- Comment.nvim
|
-- Comment.nvim
|
||||||
require('Comment').setup({
|
require('Comment').setup({
|
||||||
opleader = {
|
opleader = {
|
||||||
line = '<leader>cl',
|
line = '<C-_>',
|
||||||
block = '<leader>cb',
|
|
||||||
}
|
|
||||||
})
|
|
||||||
wk.register({
|
|
||||||
["<leader>"] = {
|
|
||||||
c = {
|
|
||||||
l = { "Line comment" },
|
|
||||||
b = { "Block comment" },
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
" ~/.vimrc
|
" ~/.vimrc
|
||||||
"
|
"
|
||||||
" ~ M. Thomas
|
" ~ M. Thomas
|
||||||
|
|
||||||
let mapleader = "\<Space>"
|
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
|
let g:netrw_banner = 0 " Remove useless banner at the top of netrw
|
||||||
|
|
||||||
" ============================== Macros and Mappings
|
" ============================== Macros and Mappings
|
||||||
" fzf
|
" file interaction
|
||||||
map <C-f> :Files<CR>
|
let g:fzf_preview_window = ['down,50%', 'ctrl-/']
|
||||||
map <C-g> :GFiles<CR>
|
|
||||||
command! -bang -nargs=* GGrep
|
command! -bang -nargs=* GGrep
|
||||||
\ call fzf#vim#grep(
|
\ call fzf#vim#grep(
|
||||||
\ 'git grep --line-number -- '.shellescape(<q-args>), 0,
|
\ '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")
|
map <C-p> :Files<CR>
|
||||||
if v:shell_error == 0
|
map <C-f> :GGrep
|
||||||
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>
|
|
||||||
|
|
||||||
fun! TrimWhitespace()
|
fun! TrimWhitespace()
|
||||||
let l:save = winsaveview()
|
let l:save = winsaveview()
|
||||||
|
|||||||
Reference in New Issue
Block a user