Skip to content

Commit

Permalink
feat!: replace vim-qf with builtin cfilter pack
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyinzuo committed Jul 17, 2024
1 parent 027b8b4 commit 41aa90b
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 27 deletions.
6 changes: 5 additions & 1 deletion .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ if has('autocmd') " vim-tiny does not have autocmd
endif
" vim7.3+
set conceallevel=2
if v:version >= 801 || has('nvim')
if v:version >= 801
" https://unix.stackexchange.com/questions/149209/refresh-changed-content-of-file-opened-in-vim/383044#383044
" Set to auto read when a file is changed from the outside
set autoread
Expand All @@ -168,6 +168,10 @@ if has('autocmd') " vim-tiny does not have autocmd
" Notification after file change
" https://vi.stackexchange.com/questions/13091/autocmd-event-for-autoread
autocmd FileChangedShellPost * echohl WarningMsg | echo "File changed on disk. Buffer reloaded." | echohl Noneau FocusGained,BufEnter * checktime
if has('patch-8.1.311')
" filter quickfix list, do not use vim-qf plugin
packadd cfilter
endif
endif

" Enable persistent undo so that undo history persists across vim sessions
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

[wiki](https://github.com/jiangyinzuo/vimrc/wiki)

My personal vim/neovim configuration files, dotfiles and other scripts. Feel free to contact me or open an issue/PR if you have any questions or suggestions.

> "User-friendly," "universal," and "easy to use" form the impossible trinity of tools.
>
> 好用,通用,易用,是工具的不可能三角。
My personal vim/neovim configuration files, dotfiles and other scripts.

## Requirements and Installation

Expand Down
1 change: 0 additions & 1 deletion root/.config/nvim/lua/plugins/vimplug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ local M = {
"preservim/vimux",
"honza/vim-snippets",
"voldikss/vim-translator",
"romainl/vim-qf",
{
"mechatroner/rainbow_csv",
ft = "csv",
Expand Down
3 changes: 3 additions & 0 deletions root/.vim/doc/code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ vim:ft=help
全字匹配
:grep -w def foo.py

文件内case insensitive search
/\chello

使用grep ~
`grep 'func main' -r --exclude tags .`
`grep 'func main' ~/hello.go` 查找~/hello.go文件中的func main
Expand Down
5 changes: 5 additions & 0 deletions root/.vim/doc/git/git-help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ git submodule add ../onnxruntime.git onnxruntime
*git-submodule-deinit*
git submodule deinit 节省git仓库空间

git submodule只有.git文件/目录的解决方法
>bash
git submodule deinit -f -- contrib/mariadb-connector-c
git submodule update --init --depth=1 -- contrib/mariadb-connector-c
<
-------------------------------------------------------------------------------
*detached-git-directory* *git目录* *gitdir*

Expand Down
6 changes: 0 additions & 6 deletions root/.vim/doc/mydoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ recording a macro: >
*add-to-the-begin-of-line* `:%s/^/hello /g`
*put-grep-results-into-quickfixlist-then-execute-by-cdo* `:cdo %s/<search term>/<replace term>/cg`

*filter-quickfix* >
:packadd cfilter
:vimgrep /foo/
:Cfilter /runtime/
<

-------------------------------------------------------------------------------
Undo System ~

Expand Down
11 changes: 11 additions & 0 deletions root/.vim/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ if has('autocmd') " vim-tiny does not have autocmd
" Notification after file change
" https://vi.stackexchange.com/questions/13091/autocmd-event-for-autoread
autocmd FileChangedShellPost * echohl WarningMsg | echo "File changed on disk. Buffer reloaded." | echohl Noneau FocusGained,BufEnter * checktime
if has('patch-8.1.311')
" filter quickfix list, do not use vim-qf plugin
packadd cfilter
endif
endif

" Enable persistent undo so that undo history persists across vim sessions
Expand Down Expand Up @@ -333,6 +337,13 @@ if has('autocmd') " vim-tiny does not have autocmd
" neovim 0.10.0 uses ripgrep as greppg by default
command! -nargs=1 RgToQf call noplug#SystemToQf('rg --vimgrep ' . <q-args>)

noremap ]q :call noplug#ToggleQuickfix('c')<CR>
noremap ]l :call noplug#ToggleQuickfix('l')<CR>
nnoremap <silent> <leader>cn :cn<CR>
nnoremap <silent> <leader>cp :cp<CR>
nnoremap <silent> <leader>ln :ln<CR>
nnoremap <silent> <leader>lp :lp<CR>
" [[palette]]执行系统命令并输出到quickfix list :SystemToQf
command! -nargs=1 SystemToQf call noplug#SystemToQf(<q-args>)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
Expand Down
13 changes: 0 additions & 13 deletions root/.vim/vimrc.d/plugin_setup.vim
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ if v:version >= 800
" 这样的补全,使用F12
let g:UltiSnipsExpandTrigger="<f12>"

let g:qf_auto_open_quickfix = 0
nmap <leader>cn <Plug>QfCnext
nmap <leader>cp <Plug>QfCprevious
nmap <leader>ln <Plug>QfLnext
nmap <leader>lp <Plug>QfLprevious
" 默认csv带有header
let g:rbql_with_headers = 1
let g:rainbow_comment_prefix = '#'
Expand Down Expand Up @@ -135,14 +129,7 @@ if v:version >= 800

exe command_def . 'QfGitDiff call open_gitdiff#select("enew", function("open_gitdiff#quickfix#view"), <f-args>)'
command -nargs=+ -complete=customlist,fugitive#LogComplete GitDiff2Paths call open_gitdiff#open_diff_by_path(<f-args>)
else
nnoremap <silent> <leader>cn :cn<CR>
nnoremap <silent> <leader>cp :cp<CR>
nnoremap <silent> <leader>ln :ln<CR>
nnoremap <silent> <leader>lp :lp<CR>
endif
noremap ]q :call noplug#ToggleQuickfix('c')<CR>
noremap ]l :call noplug#ToggleQuickfix('l')<CR>

let g:caser_prefix = 'gs'

Expand Down
1 change: 0 additions & 1 deletion root/.vim/vimrc.d/vimplug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ if v:version >= 800
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'voldikss/vim-translator'
Plug 'romainl/vim-qf'

Plug 'mechatroner/rainbow_csv', { 'for': 'csv' }

Expand Down

0 comments on commit 41aa90b

Please sign in to comment.