home/nvim: add qc/lc binds, replace rg with ug

This commit is contained in:
Gabriel Fontes
2022-09-26 13:10:14 -03:00
parent faf2de8bc8
commit a3131b4bd3
4 changed files with 28 additions and 7 deletions
+1 -1
View File
@@ -24,7 +24,7 @@
bottom # System viewer
ncdu # TUI disk usage
exa # Better ls
ripgrep # Better grep
ugrep # Better grep
fd # Better find
httpie # Better curl
jq # JSON pretty printer and manipulator
-2
View File
@@ -4,8 +4,6 @@
enable = true;
shellAbbrs = {
ls = "exa";
cat = "bat";
top = "btm";
jqless = "jq -C | less -r";
+25 -3
View File
@@ -52,14 +52,36 @@
nmap <C-j> <C-e>
nmap <C-k> <C-y>
nmap <space>q <cmd>cwindow<cr>
nmap <space>l <cmd>lwindow<cr>
"Buffers
set wildcharm=<C-Z>
nmap <space>b :buffer <C-Z>
nmap <C-l> :bnext<CR>
nmap <C-h> :bprev<CR>
nmap <C-q> :bdel<CR>
"Loclist
nmap <space>l :lwindow<cr>
nmap [l :lprev<cr>
nmap ]l :lnext<cr>
nmap <space>L :lhistory<cr>
nmap [L :lolder<cr>
nmap ]L :lnewer<cr>
"Quickfix
nmap <space>q :cwindow<cr>
nmap [q :cprev<cr>
nmap ]q :cnext<cr>
nmap <space>Q :chistory<cr>
nmap [Q :colder<cr>
nmap ]Q :cnewer<cr>
"Use ugrep as :grep
if executable('ugrep')
set grepprg=ugrep\ -RInk\ -j\ -u\ --tabs=1\ --ignore-files
set grepformat=%f:%l:%c:%m,%f+%l+%c+%m,%-G%f\\\|%l\\\|%c\\\|%m
endif
'';
plugins = with pkgs.vimPlugins; [
+2 -1
View File
@@ -15,7 +15,8 @@
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, { desc = "Floating diagnostic" })
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Previous diagnostic" })
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
vim.keymap.set("n", "gl", vim.diagnostic.setloclist, { desc = "Diagnostics on loclist" })
vim.keymap.set("n", "gq", vim.diagnostic.setqflist, { desc = "Diagnostics on quickfix" })
function add_sign(name, text)
vim.fn.sign_define(name, { text = text, texthl = name, numhl = name})