Closed rober-m closed 3 years ago
To clarify, the Zettel_____ functions keep working on my original remaps. But I get the same result for both <leader>ot
and <leader>of
, and the same applies for [[
and [f
. It seems that the title:
is ignored now.
When mapping following the documentation, the mappings are completely ignored. Like I didn't do anything.
Notes:
:[[
thing happens when I follow the documentation.filetype_vimwiki
.It might be your g:zettel_fzf_options, which control the arguments passed to fzf behind the scenes.
In particular, fzf has a setting where if you type multiple words, it'll search for each of them individually. If that was on it'd explain your results. I'd run:
:echo g:zettel_fzf_options
Copy what it is, then add then add +x to it to turn this setting off. I also turned off exact mode and added --algo=v2 for fuzzy searching, and like that better than the default.
@nathanbraun I've read the fzf documentation regarding your comment and tried the arguments. Although it's valuable information (thanks), it isn't related to my issue.
The issue is that the title:
keyword isn't automatically written on the fzf search bar. And the behavior of
nnoremap <leader>ot :ZettelOpen<CR>title:
is the same as
nnoremap <leader>ot :ZettelOpen<CR>
once I type title:
it works as intended.
@IIPatternII interesting, I actually recently updated vim-zettel and now am running into the same issue
@IIPatternII I looked at the source code a bit. The following in my neovim config fixes it for me:
let g:zettel_default_mappings = 0
augroup filetype_vimwiki
autocmd!
" insert file bindings
inoremap [[ [[<esc>:ZettelSearch<CR>:title
inoremap [f [[<ESC>:ZettelSearch<CR>
" open file bindings
nnoremap <leader>ot :ZettelOpen<CR>title:
nnoremap <leader>of :ZettelOpen<CR>
" other, normal bindings
nmap T <Plug>ZettelYankNameMap
xmap zx <Plug>ZettelNewSelectedMap<CR>
nmap gZ <Plug>ZettelReplaceFileWithLink
augroup END
@nathanbraun Sorry for the late answer. I solved the issue a little differently:
function! ZettelTitleSearch()
let g:zettel_fzf_command = "rg --column --line-number --smart-case --multiline --no-heading --color=always --regexp '^title: (.+)' --replace '$1'"
ZettelOpen()
endfunction
nnoremap <leader>ot :call ZettelTitleSearch()<CR>
function! ZettelFullSearch()
let g:zettel_fzf_command = "rg --column --line-number --smart-case --multiline --no-heading --color=always"
ZettelOpen()
endfunction
nnoremap <leader>of :call ZettelFullSearch()<CR>
I'm no longer using vim-zettel. I switched to Obsidian with the Vim plugin (lacking functionality but good enough), but I'm leaving this in case someone finds it useful.
Hi! My remaps stopped working when updated to the new version. These are my old remaps:
I read the documentation and changed the remaps to:
They still don't work. Also, now the
[[
command inserts:[[
. 🤔