inkarkat / vim-mark Goto Github PK
View Code? Open in Web Editor NEWThis project forked from vim-scripts/mark
Highlight several words in different colors simultaneously.
Home Page: http://www.vim.org/scripts/script.php?script_id=2666
This project forked from vim-scripts/mark
Highlight several words in different colors simultaneously.
Home Page: http://www.vim.org/scripts/script.php?script_id=2666
Hello,
When marking with "m" on mark-3.0.0, I get the following error.
Error detected while processing function mark#MarkCurrentWord[13]..mark#DoMark:line 1:
E117: Unknown function: ingo#err#Clear
mark-1/\<config\>
Press ENTER or type command to continue
Marking still works though.
More details comes below.
If you have any problem to reproduce the issue, let me know.
Regards,
Sangho
hi, I encountered the below issue, Could you please help to have a look? Thanks.
Error detected while processing function mark#MarkCurrentWord[13]..mark#DoMark:
:ver
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 10 2018 21:31:58)
Included patches: 1-1453
Distro: Ubuntu 18.04 LTS
When I am trying to clear all marks using <leader>n I get the following message:
"Do not pass empty pattern to disable all marks"
Is there anything I can do to solve this?
Currently I've changed the row:
nmap <unique> <Leader>n <Plug>MarkClear
to
nmap <unique> <Leader>n :MarkClear<cr>
Just for a few trivial MSG and ERR that nobody cares, we have to install a library containing at least 100 files, and 99.9% of them are not used by 99.9% of people.
This is just bad practice.
while the changelog later mentions it, the installation section just tells to git clone this repo, while you need that ingo library repo too. It should be eplicitly mentioned in the installation section that it is needed.
Motivation
I've just installed the plugin without reading the documentation to simply try it out, as I usually do for vim plugins, and it greeted me with a confusing error:
Error detected while processing function mark#SetMark[18]..mark#DoMarkAndSetCurrent[9]..mark#DoMark:
line 1:
E117: Unknown function: ingo#err#Clear
Error detected while processing function mark#SetMark[18]..mark#DoMarkAndSetCurrent[9]..mark#DoMark[32]..<SNR>175_MarkEnable[10]..mark#UpdateScope:
line 1:
E117: Unknown function: ingo#window#iterate#All
At first I assumed the plugin was unmaintained, buggy or something was wrong with my setup, but I wanted it bad enough that I kept trying and found issue #5 that explains the problem.
Request and Purpose
Add an error message that simply states the plugin requires an additional dependency and where to find it. Preferably when the user tries to run the :Mark
command (non-invasive), but alternatively when loading the plugin.
It is not super common for plugins to require another plugin and the error message make users assume something is broken and might cause them to uninstall the plugin altogether. It seems as though adding as simple if
would be enough, so it would be a simple change.
Motivation
In vim I use fugitive plugin :Git grep
together with vim-mark plugin :Mark
to search the word under coursor in code and show quick-fix window with matched lines with the searched word highlighted.
I use vim remap for this:
nnoremap gr :let @/=""<CR>:Mark <C-R><C-W><CR>:silent exec ":Ggrep! -w <C-R><C-W>"<CR>:copen<CR>:redr!<CR>
The result looks like this:
And I face the problem that when I want to search for already highlighted word (e.g.: search something second time while it's still highlighted), :Mark
would just clear the mark on the word, but I don't want it to be cleared.
Request and Purpose
So I need a way (instead of just Toggle) to add a mark if it is not yet added and don't clear the mark if it's already there.
I've added a draft POC of what I mean. https://github.com/Snorch/vim-mark/tree/dont-clear-mark-if-exists But I'm not too good at vim plugin writing, and failed to find a proper place to integrate it, it looks like a crutch now. But with this I can grep same words multiple time with my command without losing highlight, and I can still clear the mark with <Leader>m
when needed.
Probably I'm doing something wrong, or just don't see how to do it properly, please help.
This is caused by 6016b28. I guess neovim doesn't have support for -addr=other?
I can't find -addr=other in the docs for command at least.
Hi
I like to use ALE to check my files. When there are errors, ALE colours them which is great. But if I have a highlight mark set on a word, and that word is inside an error marked as an error by ALE, the mark doesn't show up. Even if I set
hi ALEError gui=NONE
Is there any way to give marks a higher precedence so they show up on top of these errors?
Thanks
The README says that I can directly jump to the next or previous occurrence of a particular highlight group by using the numeric keypad. However, it doesn't seem to actually work for me.
I have created two highlight groups by doing 1\m
and 2\m
. I'm then supposed to press a digit on the numeric keypad (1
or 2
in my case) in normal mode, without any leader key, right? That does nothing for me, even though there are occurrences of the marks above and below my cursor's current line. I do know the difference between the numeric keypad versus the row of digits above the letters on the keyboard. I have also ensured that Num Lock is on.
If I look at the key mappings using :nmap
, I see that the numeric keypad digits should be mapped correctly:
n <C-k9> <Plug>MarkSearchGroup9Prev
n <Plug>MarkSearchGroup9Prev * :<C-U>if ! mark#SearchGroupMark(9, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k9> <Plug>MarkSearchGroup9Next
n <Plug>MarkSearchGroup9Next * :<C-U>if ! mark#SearchGroupMark(9, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k8> <Plug>MarkSearchGroup8Prev
n <Plug>MarkSearchGroup8Prev * :<C-U>if ! mark#SearchGroupMark(8, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k8> <Plug>MarkSearchGroup8Next
n <Plug>MarkSearchGroup8Next * :<C-U>if ! mark#SearchGroupMark(8, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k7> <Plug>MarkSearchGroup7Prev
n <Plug>MarkSearchGroup7Prev * :<C-U>if ! mark#SearchGroupMark(7, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k7> <Plug>MarkSearchGroup7Next
n <Plug>MarkSearchGroup7Next * :<C-U>if ! mark#SearchGroupMark(7, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k6> <Plug>MarkSearchGroup6Prev
n <Plug>MarkSearchGroup6Prev * :<C-U>if ! mark#SearchGroupMark(6, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k6> <Plug>MarkSearchGroup6Next
n <Plug>MarkSearchGroup6Next * :<C-U>if ! mark#SearchGroupMark(6, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k5> <Plug>MarkSearchGroup5Prev
n <Plug>MarkSearchGroup5Prev * :<C-U>if ! mark#SearchGroupMark(5, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k5> <Plug>MarkSearchGroup5Next
n <Plug>MarkSearchGroup5Next * :<C-U>if ! mark#SearchGroupMark(5, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k4> <Plug>MarkSearchGroup4Prev
n <Plug>MarkSearchGroup4Prev * :<C-U>if ! mark#SearchGroupMark(4, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k4> <Plug>MarkSearchGroup4Next
n <Plug>MarkSearchGroup4Next * :<C-U>if ! mark#SearchGroupMark(4, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k3> <Plug>MarkSearchGroup3Prev
n <Plug>MarkSearchGroup3Prev * :<C-U>if ! mark#SearchGroupMark(3, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k3> <Plug>MarkSearchGroup3Next
n <Plug>MarkSearchGroup3Next * :<C-U>if ! mark#SearchGroupMark(3, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k2> <Plug>MarkSearchGroup2Prev
n <Plug>MarkSearchGroup2Prev * :<C-U>if ! mark#SearchGroupMark(2, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k2> <Plug>MarkSearchGroup2Next
n <Plug>MarkSearchGroup2Next * :<C-U>if ! mark#SearchGroupMark(2, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k1> <Plug>MarkSearchGroup1Prev
n <Plug>MarkSearchGroup1Prev * :<C-U>if ! mark#SearchGroupMark(1, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k9> <Plug>MarkSearchGroup9Prev
n <Plug>MarkSearchGroup9Prev * :<C-U>if ! mark#SearchGroupMark(9, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k9> <Plug>MarkSearchGroup9Next
n <Plug>MarkSearchGroup9Next * :<C-U>if ! mark#SearchGroupMark(9, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k8> <Plug>MarkSearchGroup8Prev
n <Plug>MarkSearchGroup8Prev * :<C-U>if ! mark#SearchGroupMark(8, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k8> <Plug>MarkSearchGroup8Next
n <Plug>MarkSearchGroup8Next * :<C-U>if ! mark#SearchGroupMark(8, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k7> <Plug>MarkSearchGroup7Prev
n <Plug>MarkSearchGroup7Prev * :<C-U>if ! mark#SearchGroupMark(7, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k7> <Plug>MarkSearchGroup7Next
n <Plug>MarkSearchGroup7Next * :<C-U>if ! mark#SearchGroupMark(7, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k6> <Plug>MarkSearchGroup6Prev
n <Plug>MarkSearchGroup6Prev * :<C-U>if ! mark#SearchGroupMark(6, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k6> <Plug>MarkSearchGroup6Next
n <Plug>MarkSearchGroup6Next * :<C-U>if ! mark#SearchGroupMark(6, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k5> <Plug>MarkSearchGroup5Prev
n <Plug>MarkSearchGroup5Prev * :<C-U>if ! mark#SearchGroupMark(5, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k5> <Plug>MarkSearchGroup5Next
n <Plug>MarkSearchGroup5Next * :<C-U>if ! mark#SearchGroupMark(5, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k4> <Plug>MarkSearchGroup4Prev
n <Plug>MarkSearchGroup4Prev * :<C-U>if ! mark#SearchGroupMark(4, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k4> <Plug>MarkSearchGroup4Next
n <Plug>MarkSearchGroup4Next * :<C-U>if ! mark#SearchGroupMark(4, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k3> <Plug>MarkSearchGroup3Prev
n <Plug>MarkSearchGroup3Prev * :<C-U>if ! mark#SearchGroupMark(3, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k3> <Plug>MarkSearchGroup3Next
n <Plug>MarkSearchGroup3Next * :<C-U>if ! mark#SearchGroupMark(3, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k2> <Plug>MarkSearchGroup2Prev
n <Plug>MarkSearchGroup2Prev * :<C-U>if ! mark#SearchGroupMark(2, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <k2> <Plug>MarkSearchGroup2Next
n <Plug>MarkSearchGroup2Next * :<C-U>if ! mark#SearchGroupMark(2, v:count1, 0, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
n <C-k1> <Plug>MarkSearchGroup1Prev
n <Plug>MarkSearchGroup1Prev * :<C-U>if ! mark#SearchGroupMark(1, v:count1, 1, 1)|execute "normal! \<C-\>\<C-n>\<Esc>"|echoerr ingo#err#Get()|endif<CR>
OS: Ubuntu Desktop Bionic Beaver x86-64
Vim version:
$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 10 2018 21:31:58)
Included patches: 1-1453
Modified by [email protected]
Compiled by [email protected]
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_sgr -tag_any_white
+arabic +file_in_path -mouse_sysmouse -tcl
+autocmd +find_in_path +mouse_urxvt +termguicolors
-autoservername +float +mouse_xterm +terminal
-balloon_eval +folding +multi_byte +terminfo
+balloon_eval_term -footer +multi_lang +termresponse
-browse +fork() -mzscheme +textobjects
++builtin_terms +gettext +netbeans_intg +timers
+byte_offset -hangul_input +num64 +title
+channel +iconv +packages -toolbar
+cindent +insert_expand +path_extra +user_commands
-clientserver +job -perl +vertsplit
-clipboard +jumplist +persistent_undo +virtualedit
+cmdline_compl +keymap +postscript +visual
+cmdline_hist +lambda +printer +visualextra
+cmdline_info +langmap +profile +viminfo
+comments +libcall -python +vreplace
+conceal +linebreak +python3 +wildignore
+cryptv +lispindent +quickfix +wildmenu
+cscope +listcmds +reltime +windows
+cursorbind +localmap +rightleft +writebackup
+cursorshape -lua -ruby -X11
+dialog_con +menu +scrollbind -xfontset
+diff +mksession +signs -xim
+digraphs +modify_fname +smartindent -xpm
-dnd +mouse +startuptime -xsmp
-ebcdic -mouseshape +statusline -xterm_clipboard
+emacs_tags +mouse_dec -sun_workshop -xterm_save
+eval +mouse_gpm +syntax
+ex_extra -mouse_jsbterm +tag_binary
+extra_search +mouse_netterm +tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -fdebug-prefix-map=/build/vim-NQEcoP/vim-8.0.1453=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lm
I'm using vim in Ubuntu Bionic Beaver's Terminal app, in the GNOME graphical desktop environment.
What can I do to help debug?
I have mappings that vim-mark attempts to redefine, so at each vim startup, I get:
Error detected while processing /home/a84089393/.vim/bundle/vim-mark/plugin/mark.vim:
line 163:
E227: mapping already exists for n
How can I suppress the warnings? Thanks in advance and a separate thank you for this great plugin.
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 18 2018 21:31:49)
macOS version
Included patches: 1-1614
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +comments +file_in_path +linebreak +mouse_urxvt +quickfix +terminal +windows
+arabic +conceal +find_in_path +lispindent +mouse_xterm +reltime +terminfo +writebackup
+autocmd +cryptv +float +listcmds +multi_byte +rightleft +termresponse -X11
-autoservername +cscope +folding +localmap +multi_lang +ruby +textobjects -xfontset
-balloon_eval +cursorbind -footer -lua -mzscheme +scrollbind +timers -xim
+balloon_eval_term +cursorshape +fork() +menu +netbeans_intg +signs +title -xpm
-browse +dialog_con -gettext +mksession +num64 +smartindent -toolbar -xsmp
++builtin_terms +diff -hangul_input +modify_fname +packages +startuptime +user_commands -xterm_clipboard
+byte_offset +digraphs +iconv +mouse +path_extra +statusline +vertsplit -xterm_save
+channel -dnd +insert_expand -mouseshape +perl -sun_workshop +virtualedit
+cindent -ebcdic +job +mouse_dec +persistent_undo +syntax +visual
-clientserver +emacs_tags +jumplist -mouse_gpm +postscript +tag_binary +visualextra
+clipboard +eval +keymap -mouse_jsbterm +printer +tag_old_static +viminfo
+cmdline_compl +ex_extra +lambda +mouse_netterm +profile -tag_any_white +vreplace
+cmdline_hist +extra_search +langmap +mouse_sgr -python -tcl +wildignore
+cmdline_info +farsi +libcall -mouse_sysmouse +python3 +termguicolors +wildmenu
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o vim -lncurses -liconv -framework AppKit -mmacosx-version-min=10.13 -fstack-protector-strong -L/usr/local/lib -L/usr/local/Cellar/perl/5.26.1/lib/perl5/5.26.1/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -L/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin -lpython3.6m -framework CoreFoundation -lruby.2.5.0 -lobjc
set nocompatible
let &rtp=&rtp.','.$HOME.'/.vim/bundle/vim-mark'
colorscheme desert "default setting
filetype plugin indent on
syntax on
:Mark
Describe the bug
When I specify a multi line regular expression for match, use <Leader>/
is fine for next occurence, but after the cursor is on highlight, *
don't jump to next mark, instead it becomes vim normal *
which simply search for the word under cursor
How to Reproduce
For example, using the following text
This is a test
for inkarkat vim-mark
I want to mark a pattern
in multiple lines
the cursor is on the search
but * becomes vim superstar for normal search
:Mark /.*vim.*\n.*pattern/
, this will mark line 2 and line 3<Leader>/
to jump to the first(only) Mark match*
, this time it searches for for
under cursor instead for the next mark occurrenceEnvironment
Motivation
The mappings defined are many and tools such as which-key
will be over-filled. Moreover, if one doesn't like your mappings, he has to disable them one by one...
Request and Purpose
A global variable that conditions the set of default mappings
Hi Ingo, thank you for maintaining this plugin. Looking at the docs I can't seem to find a solution for this. If I mark a word by double-clicking it, it is not 'selected' in Vim, and therefore I cannot CTRL-C (in Windows) to copy this word to the clipboard anymore. So basically, if I double-click a word, it gets highlighted (good), but then I have to manually drag my mouse over it to "select" it for copy (bad). Is there a workaround for this that I'm missing?
Thank you!
When I execute the :Mark command with a highlight group number and a patterns, as for example,
:3Mark /hello/
and there are fewer than 3 lines in the buffer, Vim displays the error message
E16: Invalid range
I am using Mark-3.1.0, ingo-library-1.041 and Vim 8.2.1081 on Ubuntu 18.04. The behavior is the same using Vim 8.2.1101 on Windows 10.
The bug appears to be due to the definition of the :Mark command in plugin/mark.vim. The :Mark command is defined with the -range option, so Vim assumes that the number preceding the command is a range. When a highlight group number is used in front of the :Mark command, Vim sees this as a line number and if the line number does not exist, Vim issues the error message.
This can be fixed by replacing the -range option with the -count option, since only the parameter is used in the command. I have tried this fix and it has it worked so far.
Motivation
I sometimes make custom marks when writing text files - highlighting certain words to make the text more readable.
It would be neat to not lose this the next time I open the file.
Request and Purpose
Support setting marks through modelines. E.g. adding this to the top of a file:
# vim: mark1 /foo/
I could not find a way of doing this in the help file, and the string modeline
is nowhere in the help file, so I don't think this is possible at the moment?
Alternatives
Saving the file as some custom file extension .foo
, then :!echo "1Mark foo" > ~/.vim/ftplugin/foo.vim
This is a reasonable approach if you have many files with similar file extensions, but it creates a bunch of crap in your vim config folder if you have single files. It also forces you to use "wrong" file extensions.
Hi there,
I was hoping we could discuss an unrelated idea for a plugin I want to create, but I'm unsure which method would be the fastest and if it would be possible to accomplish in vim without much lag.
I want to create a buffer anonymizer. Something similar to mzggg?G`z, except instead of doing a ROT13 on the text it would convert all characters to squares. Basically, I want to achieve something similar to:
The problem is, I want to keep the current highlighting group of every character in the buffer after I swap each character for a square. Do you have an idea how might I go about doing that?
EDIT: I found a better image
Hi I used tag 3.0.0 and I got error
Error detected while processing function mark#MarkCurrentWord[13]..mark#DoMark:
line 1:
E117: Unknown function: ingo#err#Clear
I have impression that functions there by accident.
This might be potentially be an issue with base16 themes (https://github.com/chriskempson/base16-vim) or likely something in my setup/environment, but I wanted to run this by you just in case and ask for help in debugging.
The problem is when I use one of the base16-themes (set in my vimrc), then setting a mark does not do any highlighting. There are otherwise no errors/messages, and if I toggle the mark at this point, the status message indicates the mark is actually getting cleared. However visually the selected word is not marked with coloring at all, even though the mark is getting set and cleared.
This happens only when I use the base16 theme. No issues at all with any other theme.
However I noticed the following which may offer some clues, maybe. After loading with base16 theme, if I do a MarkPalette extended
(or any other palette) then setting the marks works just fine. The marks that I had set previously also now get highlighted (colored).
The problem also clears up if I load another vim colorscheme, and then load the base16 theme back again.
It's as if something somewhere is not getting initialized correctly or is getting overwritten during startup. Does this ring any bell for you?
Again this problem happens only when using a base16 theme, every other color theme I've possibly used has never exhibited this issue.
I'm using the latest vim sources and latest source of both base16 and vim-mark sources.
Thank you.
Hi,
is there an option to apply vim-mark only to certain filetypes?
I am using it persistently with denite and vimfiler, but do not want to have it active by default e.g. for python.
Thanks
Motivation
I want to use vim's regular n
and N
keys to cycle forward/backward through any mark if there is any mark defined. Otherwise, I'd like n
and N
to perform their usual function.
Request and Purpose
If there are any marks defined, I'd like n
and N
to perform MarkSearchAnyNext
and MarkSearchAnyPrev
, respectively. If there are no marks, or all the marks are disabled, I'd like n
and N
to fall back to their usual function.
This should obviously be configurable as not all users will want this.
Alternatives
Alternatively, adding, removing or toggling marks could update vim's last search pattern. The downside of this solution is that you lose the ability to highlight each mark in a separate colour (at least until you do :nohl
).
Describe the bug
Due to how github search algorithm works, it's impossible to search for this plugin by it's name, that is: vim-mark
.
This happens because this repo is forked from other one.
How to Reproduce
Search vim-mark
from github.com front page, observe there are no results for vim-mark
, even many pages down.
But less popular & less maintained scripts, that are not forks, will be shown.
I think this is serious issue in popularity of this plugin.
Expected Behavior
Remove forked from vim-scripts/Mark
from this repo (make it not a fork somehow (maybe contact github.com stuff or recreate repo (in the long term, it will be beneficial still))).
Environment
When I open vim, mark plugin seems to have issue to load its history.
Whatever the file I open (even starting vim withotu any file), I get the following error:
Error detected while processing function <SNR>52_AutoLoadMarks:
line 1:
E691: Can only compare List with List
Error detected while processing function <SNR>52_AutoLoadMarks:
line 1:
E15: Invalid expression: g:mwAutoLoadMarks && exists('g:MARK_MARKS') && g:MARK_MARKS !=# '[]'
I tried to wipe the .nvinfo
file, I still the same error.
NVIM v0.3.2-1041-g05d8a46ec
7d885bd Documentation: Minor: Use :set ^= instead of += for 'viminfo'
13674a6 Add ingo#collections#SortOnOneAttribute(), ingo#collections#PrioritySort(), and ingo#collections#SortOnTwoAttributes()
Hi,
Great plugin! But i just found out that key mapping has conflict with vim-jedi plugin. Would it be possible to have remapping options via "let" ?
When I manually source .vimrc file (i.e. to load new settings), it make all highlighting disappear.
How to Reproduce
I use VIM 9.0 and plugin is installed via Vundle.
I have to quit vim and start it again to make it work.
Expected Behavior
Sourcing .vimrc file should have no impact on plugin functionality.
Environment
noautocmd windo call call('mark#UpdateMark', a:000)
will add a needless jumplist entry, it will be better add keepjumps
noautocmd keepjumps windo call call('mark#UpdateMark', a:000)
I've got error on refreshing marks:
Error detected while processing function mark#UpdateScope[7]..mark#UpdateMark:
line 2:
E117: Unknown function: ingo#actions#EvaluateOrFunc
E15: Invalid expression: ingo#actions#EvaluateOrFunc(l:Predicate)
Which is caused by ingo#actions#EvaluateOrFunc
which doesn't exists.
I installed this plugin with vim-plug, upon first usage of m I got a bunch of undefined function errors. After adding the vim-ingo-library these errors resolved. I would suggest adding a note in the readme installation section that https://github.com/inkarkat/vim-ingo-library should be installed along with this one.
Thanks for the awesome plugin.
Frequent Issues
Describe the bug
A clear and concise description of what the bug is.
How to Reproduce
Detailed steps to reproduce the behavior.
Expected Behavior
A clear and concise description of what you expected to happen.
Environment
vim --version
.Describe the bug
Window with WinBar
gets smaller every time add or delete mark.
This happens in other window, that is, window where to add mark, and window with WinBar
should be 2 different windows. And their location is: window with text above, window with WinBar
directly below window with text where add / delete mark happens.
If there's no WinBar
, this bug does not happen.
How to Reproduce
vim
or gvim
^Ws
to splitnnoremenu WinBar.test1 1.10 :anything
nnoremenu WinBar.test2 1.20 :anything
<Leader>m
to mark & unmark any textExpected Behavior
Windows sizes don't change.
Environment
vim --version
:VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Feb 10 2021 11:11:17)
Included patches: 1-2489
Huge version with GTK3 GUI. Features included (+) or not (-):
+acl -farsi +mouse_sgr +tag_binary
+arabic +file_in_path -mouse_sysmouse -tag_old_static
+autocmd +find_in_path +mouse_urxvt -tag_any_white
+autochdir +float +mouse_xterm -tcl
+autoservername +folding +multi_byte +termguicolors
+balloon_eval -footer +multi_lang +terminal
+balloon_eval_term +fork() -mzscheme +terminfo
+browse -gettext +netbeans_intg +termresponse
++builtin_terms -hangul_input +num64 +textobjects
+byte_offset +iconv +packages +textprop
+channel +insert_expand +path_extra +timers
+cindent +ipv6 -perl +title
+clientserver +job +persistent_undo +toolbar
+clipboard +jumplist +popupwin +user_commands
+cmdline_compl +keymap +postscript +vartabs
+cmdline_hist +lambda +printer +vertsplit
+cmdline_info +langmap +profile +virtualedit
+comments +libcall -python +visual
+conceal +linebreak +python3/dyn +visualextra
+cryptv +lispindent +quickfix +viminfo
+cscope +listcmds +reltime +vreplace
+cursorbind +localmap +rightleft +wildignore
+cursorshape +lua/dyn -ruby +wildmenu
+dialog_con_gui +menu +scrollbind +windows
+diff +mksession +signs +writebackup
+digraphs +modify_fname +smartindent +X11
+dnd +mouse +sound -xfontset
-ebcdic +mouseshape +spell +xim
+emacs_tags +mouse_dec +startuptime +xpm
+eval +mouse_gpm +statusline +xsmp_interact
+ex_extra -mouse_jsbterm -sun_workshop +xterm_clipboard
+extra_search +mouse_netterm +syntax -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/home/leonid/.local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -pthread -g -O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lelf -lcanberra -lacl -lattr -lgpm -ldl
Hi I think some commit are corupted
during git clone [email protected]:inkarkat/vim-mark.git
when in .gitconfig
[transfer]
fsckobjects = true
[fetch]
fsckobjects = true
[receive]
fsckObjects = true
I got error
error: object 62aa8276d8f3dac379b70c673baead4e11dbc1ec: badTimezone: invalid author/committer line - bad time zone
fatal: Error in object
fatal: index-pack failed
Without those settings I am able to clone repository but git fsck is needed
#-> git fsck
Checking object directories: 100% (256/256), done.
error in commit 62aa8276d8f3dac379b70c673baead4e11dbc1ec: badTimezone: invalid author/committer line - bad time zone
error in commit 0dad50d4b4fbf4fa12911e133dde2989cb482ea9: badTimezone: invalid author/committer line - bad time zone
error in commit 5cc4fb24c1f138a385e9a900854d2c7adda04dfc: badTimezone: invalid author/committer line - bad time zone
error in commit fc87ef1374b417f68c5c513c5baa3adc01e07078: badTimezone: invalid author/committer line - bad time zone
error in commit 0ab4b7e435dfc19c005e52844248afaeb941c361: badTimezone: invalid author/committer line - bad time zone
error in commit 30664f3a8ff17a3bc813167d7f714a007340035e: badTimezone: invalid author/committer line - bad time zone
Checking objects: 100% (975/975), done
Motivation
Installation of the plugin could be simplified with plugin managers that support dependency declarations like VAM or VimFlavor
Request and Purpose
Thanks to an addon-info.json
installation with Vim-Addon-Manager could be transparent regarding dependencies. Just add the following file at the root of the projet:
{
"name" : "vim-mark",
"version" : "dev",
"author" : "Ingo Karkat",
"maintainer" : "Ingo Karkat",
"repository" : {"type": "git", "url": "[email protected]:inkarkat/vim-mark.git"},
"dependencies" : {
"ingo-library" : {"type" : "git", "url" : "[email protected]:inkarkat/vim-ingo-library.git"}
},
"description" : "highlighter plugin",
"homepage" : "https://github.com/inkarkat/vim-mark"
}
In vim-flavor case, the VimFlavor
file could contain
flavor 'inkarkat/vim-ingo-library', '>= 4.2.0'
(the version number could be changed to what makes sense, or removed)
Note
As vim-py automatically updates its database with the scripts registered on vim.org, VAM could just use the dependency expressed with the symbolic name associated to ingo-library (or its number. For instance, I used to use Mark%2666
to install and update your plugin with VAM).
I often want to highilght the entire line that matches a particular piece of text. I updated my copy of vim-mark as shown below to allow \M or :MarkLine to perform that function.
diff --git i/autoload/mark.vim w/autoload/mark.vim
index 0fd2cbd..0b9c482 100644
--- i/autoload/mark.vim
+++ w/autoload/mark.vim
@@ -58,7 +58,7 @@ function! s:IsIgnoreCase( expr )
endfunction
" Mark the current word, like the built-in star command.
" If the cursor is on an existing mark, remove it.
-function! mark#MarkCurrentWord( groupNum )
+function! mark#MarkCurrentWord( fullLine, groupNum )
let l:regexp = (a:groupNum == 0 ? mark#CurrentMark()[0] : '')
if empty(l:regexp)
let l:cword = expand('<cword>')
@@ -69,6 +69,9 @@ function! mark#MarkCurrentWord( groupNum )
if l:cword =~# '^\k\+$'
let l:regexp = '\<' . l:regexp . '\>'
endif
+ if a:fullLine
+ let l:regexp = '.*' . l:regexp . '.*'
+ endif
endif
endif
return (empty(l:regexp) ? 0 : mark#DoMark(a:groupNum, l:regexp)[0])
@@ -85,8 +88,12 @@ function! mark#GetVisualSelection()
let &clipboard = save_clipboard
return res
endfunction
-function! mark#GetVisualSelectionAsLiteralPattern()
- return s:EscapeText(mark#GetVisualSelection())
+function! mark#GetVisualSelectionAsLiteralPattern( fullLine )
+ let l:text = s:EscapeText(mark#GetVisualSelection())
+ if a:fullLine
+ let l:text = '.*' . l:text . '.*'
+ endif
+ return l:text
endfunction
function! mark#GetVisualSelectionAsRegexp()
return substitute(mark#GetVisualSelection(), '\n', '', 'g')
@@ -389,7 +396,6 @@ function! mark#DoMark( groupNum, ... )
return [0, 0]
endif
endif
-
let regexp = (a:0 ? a:1 : '')
if empty(regexp)
if l:groupNum == 0
@@ -492,7 +498,7 @@ function! mark#DoMarkAndSetCurrent( groupNum, ... )
return l:result
endfunction
-function! mark#SetMark( groupNum, ... )
+function! mark#SetMark( fullLine, groupNum, ... )
" For the :Mark command, don't query when the passed mark group doesn't
" exist (interactivity in Ex commands is unexpected). Instead, return an
" error.
@@ -503,6 +509,9 @@ function! mark#SetMark( groupNum, ... )
if a:0
let [l:pattern, l:nameArgument] = ingo#cmdargs#pattern#ParseUnescapedWithLiteralWholeWord(a:1, '\(\s\+as\%(\s\+\(.\{-}\)\)\?\)\?\s*')
let l:pattern = ingo#regexp#magic#Normalize(l:pattern) " We'd strictly only have to do this for /{pattern}/, not for whole word(s), but as the latter doesn't contain magicness atoms, it doesn't hurt, and with this we don't need to explicitly distinguish between the two cases.
+ if a:fullLine
+ let l:pattern = '.*' . l:pattern . '.*'
+ endif
if ! empty(l:nameArgument)
let l:name = substitute(l:nameArgument, '^\s\+as\s*', '', '')
return mark#DoMarkAndSetCurrent(a:groupNum, l:pattern, l:name)
diff --git i/plugin/mark.vim w/plugin/mark.vim
index 543c5c1..243cf02 100644
--- i/plugin/mark.vim
+++ w/plugin/mark.vim
@@ -123,8 +123,10 @@ highlight def link SearchSpecialSearchType MoreMsg
"- mappings -------------------------------------------------------------------
-nnoremap <silent> <Plug>MarkSet :<C-u>if ! mark#MarkCurrentWord(v:count)<Bar>execute "normal! \<lt>C-\>\<lt>C-n>\<lt>Esc>"<Bar>endif<CR>
-vnoremap <silent> <Plug>MarkSet :<C-u>if ! mark#DoMark(v:count, mark#GetVisualSelectionAsLiteralPattern())[0]<Bar>execute "normal! \<lt>C-\>\<lt>C-n>\<lt>Esc>"<Bar>endif<CR>
+nnoremap <silent> <Plug>MarkSet :<C-u>if ! mark#MarkCurrentWord(0,v:count)<Bar>execute "normal! \<lt>C-\>\<lt>C-n>\<lt>Esc>"<Bar>endif<CR>
+vnoremap <silent> <Plug>MarkSet :<C-u>if ! mark#DoMark(v:count, mark#GetVisualSelectionAsLiteralPattern(0))[0]<Bar>execute "normal! \<lt>C-\>\<lt>C-n>\<lt>Esc>"<Bar>endif<CR>
+nnoremap <silent> <Plug>MarkSetLine :<C-u>if ! mark#MarkCurrentWord(1,v:count)<Bar>execute "normal! \<lt>C-\>\<lt>C-n>\<lt>Esc>"<Bar>endif<CR>
+vnoremap <silent> <Plug>MarkSetLine :<C-u>if ! mark#DoMark(v:count, mark#GetVisualSelectionAsLiteralPattern(1))[0]<Bar>execute "normal! \<lt>C-\>\<lt>C-n>\<lt>Esc>"<Bar>endif<CR>
vnoremap <silent> <Plug>MarkIWhiteSet :<C-u>if ! mark#DoMark(v:count, mark#GetVisualSelectionAsLiteralWhitespaceIndifferentPattern())[0]<Bar>execute "normal! \<lt>C-\>\<lt>C-n>\<lt>Esc>"<Bar>endif<CR>
nnoremap <silent> <Plug>MarkRegex :<C-u>if ! mark#MarkRegex(v:count, '')<Bar>execute "normal! \<lt>C-\>\<lt>C-n>\<lt>Esc>"<Bar>echoerr ingo#err#Get()<Bar>endif<CR>
vnoremap <silent> <Plug>MarkRegex :<C-u>if ! mark#MarkRegex(v:count, mark#GetVisualSelectionAsRegexp())<Bar>execute "normal! \<lt>C-\>\<lt>C-n>\<lt>Esc>"<Bar>echoerr ingo#err#Get()<Bar>endif<CR>
@@ -160,9 +162,15 @@ nnoremap <silent> <Plug>MarkSearchCascadePrevNoStop :<C-u>if ! mark#cascade#
if !hasmapto('<Plug>MarkSet', 'n')
nmap <unique> <Leader>m <Plug>MarkSet
endif
+if !hasmapto('<Plug>MarkSetLine', 'n')
+ nmap <unique> <Leader>M <Plug>MarkSetLine
+endif
if !hasmapto('<Plug>MarkSet', 'x')
xmap <unique> <Leader>m <Plug>MarkSet
endif
+if !hasmapto('<Plug>MarkSetLine', 'x')
+ xmap <unique> <Leader>M <Plug>MarkSetLine
+endif
" No default mapping for <Plug>MarkIWhiteSet.
if !hasmapto('<Plug>MarkRegex', 'n')
nmap <unique> <Leader>r <Plug>MarkRegex
@@ -222,9 +230,11 @@ delfunction s:MakeDirectGroupMappings
"- commands -------------------------------------------------------------------
-command! -bang -range=0 -nargs=? -complete=customlist,mark#Complete Mark if <bang>0 | silent call mark#DoMark(<count>, '') | endif | if ! mark#SetMark(<count>, <f-args>)[0] | echoerr ingo#err#Get() | endif
+command! -bang -range=0 -nargs=? -complete=customlist,mark#Complete Mark if <bang>0 | silent call mark#DoMark(<count>, '') | endif | if ! mark#SetMark(0,<count>, <f-args>)[0] | echoerr ingo#err#Get() | endif
+command! -bang -range=0 -nargs=? -complete=customlist,mark#Complete MarkLine if <bang>0 | silent call mark#DoMark(<count>, '') | endif | if ! mark#SetMark(1,<count>, <f-args>)[0] | echoerr ingo#err#Get() | endif
command! -bar MarkClear call mark#ClearAll()
command! -bar Marks call mark#List()
+command! -bar MarkToggle call mark#Toggle()
command! -bar -nargs=? -complete=customlist,mark#MarksVariablesComplete MarkLoad if ! mark#LoadCommand(1, <f-args>) | echoerr ingo#err#Get() | endif
command! -bar -nargs=? -complete=customlist,mark#MarksVariablesComplete MarkSave if ! mark#SaveCommand(<f-args>) | echoerr ingo#err#Get() | endif
I'm getting this error when using mark.vim on marking a word (installed with vim-plug)
Error detected while processing function mark#MarkCurrentWord[13]..mark#DoMark:
line 1:
E117: Unknown function: ingo#err#Clear
mark-5/<nmap>
Motivation
Thank you so much for this plug-in! I used to use an obscur editor on Windows called emeditor because it lets you multi-highlight words. Now that I switched to Linux, I was desperate to find something that does the same. Couldn't find an editor with this feature built-in. I suspected Vim community must have made some customization that allows this. I'm so glad I find your plug-in!
I'm relatively new to Vim, especially the plug-ins side. It was not totally obvious to me how to install the plug-in.
Request and Purpose
Just add a small mention in the README that plug-in vim-ingo-library must be installed as well, The plug-in is mentioned in the dependencies section but it might not be clear enough to some that one has to explicitly install it and exactly where to find it.
I realize this requirement only after I got errors when trying to mark a word. Then, I went through the README again carefully making sure I didn't miss anything. I did read the dependencies before but assumed that it was already included with the plug-in. Then, I checked my local cloned vim-mark repo (downloaded by vim-plug) to verify if there was anything ressembling that dependency. Nothing. That's when I started to suspect I had to explicitly install it.
Alternatives
A clear and concise description of any alternative solutions or features you've considered.
hi, i get an error like:
E117: Unknown function: ingo#actions#EvaluateOrFunc
E15: 无效的表达式: ingo#actions#EvaluateOrFunc(l:Predicate)
处理 function mark#MarkCurrentWord[13]..mark#DoMark 时发生错误:
第 1 行:
E117: Unknown function: ingo#err#Clear
处理 function mark#MarkCurrentWord[13]..mark#DoMark[89]..<SNR>139_SetMark[7]..<SNR>139_EnableAndMarkScope[4]..mark#UpdateScope[7]..mark#UpdateMark 时发生错误:
第 2 行:
E117: Unknown function: ingo#actions#EvaluateOrFunc
E15: 无效的表达式: ingo#actions#EvaluateOrFunc(l:Predicate)
无效的表达式 means undefined function...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.