Comments (9)
How about your proper mappings in qf.vim by adding (as a starter)
let s:qf_mappings = {
\ "o": "<CR>",
\ "O": "<CR><c-w>p",
\ "q": "<C-W>c" }
for key_map in items(s:qf_mappings)
execute printf("nnoremap <buffer><nowait><silent> %s %s", get(key_map, 0), get(key_map, 1))
endfor
?
This way, they are available even if the qflist was populated by other means than ag.vim.
NB: O
is Ag's go
from ag.vim.
However this snippet have not solved problem of l:matches_window_prefix, which determines kind of window we are working in, but you gave me one more viewpoint for idea. So, using your link notion at thinca/vim-qfreplace#5 , resulting solution seems like:
" file: ~/.vim/after/ftplugin/qf.vim
" Thanks to: https://github.com/romainl/dotvim/blob/master/bundle/qf/after/ftplugin/qf.vim
" are we in a location list or a quickfix list?
let b:isLoc = len(getloclist(0)) > 0 ? 1 : 0
let b:wPref = b:isLoc ? 'l' : 'c'
"" Rule of Thumb: reuse editing mappings, and don't touch navigation
" q/<Space> - close / jump,
" o/O - preview/jump of and stay, I - jump into and close,
" x/X - exchange to tab foregr/backgr, S/H - split vert/horz,
let s:qf_mappings = {
\ 'q' : ':#close<CR>',
\ 'o' : '<CR><C-w>p',
\ 'O' : '<CR>',
\ 'I' : '<CR><C-w><C-w>:#close<CR>',
\ 'S' : '<C-w><CR><C-w>L<C-w>p<C-w>J<C-w>p',
\ 'H' : '<C-W><CR><C-w>K<C-w>b',
\ 'x' : '<C-w><CR><C-w>T',
\ 'X' : '<C-w><CR><C-w>TgT<C-W><C-W>',
\ '<Space>' : '<CR>',
\ }
for key_map in items(s:qf_mappings)
exec printf("nnoremap <buffer><nowait><silent> %s %s", get(key_map, 0)
\ , substitute(get(key_map, 1), '#', b:wPref, 'g'))
endfor
Issue can be closed, due to changed solution orientation.
from ag.vim.
Cool,
Note that the solution further down in the qfreplace thread is more stable than that by getloclist().
from ag.vim.
When albfan/ag.vim #21 enabling user customization will be implemented and merged into trunk, this issue could be finally closed.
from ag.vim.
@amerlyq I'm using rking/ag.vm .how about you fork, does it contains replace func?
just like easygrep
from ag.vim.
Don't know what about vim-easygrep, because its code for me seemed rather obscure and overbloated to try it even once.
I use combo of ag.vim
with quickfix-reflector.vim
when need to do some multi-file replacements. For me editing directly in qf
seems much easier.
from ag.vim.
now the most use tool for me is Unite , here is the link https://github.com/Shougo/unite.vim
from ag.vim.
it is a source tools ,you can create yourself source and ,shown by Unite
from ag.vim.
The map of mappings idea would work, but I wonder if there's a way to make a new filetype yet retain all the quickfix/location list features. If we could do that, then we could just set all the mappings in an autogroup and let people disable that or map over the mappings themselves. That might be more natural, though I've never heard of being able to alias a file type.
from ag.vim.
Related Issues (20)
- Override .gitignore paths? HOT 1
- Pressing 'e' over a search result opens the Tagbar split HOT 1
- How to search within specific subdirectories? HOT 3
- Ignore filetypes HOT 2
- Add CONTRIBUTING
- Extending the list of "working path mode" markers. HOT 7
- Maybe to add a real time preview is a good idea.
- skip NERDTree window
- First Result Opens In Current Window HOT 2
- Using --before and --after Context option with Ag and Show Results in tab/buffer HOT 1
- File Not Opening HOT 7
- Ag command can't work normally! HOT 2
- Search highlighted word HOT 2
- Any ideas why :Ag is search all the files? HOT 1
- can't git clone
- Time to remove --noheading?
- Support --ignore-dir option
- Is it possible to automatically exclude tags file from searches?
- vsplit opened on the left
- Ag searcher ignores .h files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ag.vim.