I use dashboard so I like my marks clean. So I generally make many marks while working on something and then delete them all except the file bookmark in the end. Is there any way to delete all marks except the bookmarks or the uppercase letters. So is there a way to clear all marks when opening nvim. btw I use marks.nvim so any config options for this will also be accepted

Minimal init.vim

call plug#begin('~/.config/nvim/plugged_minimal')
Plug 'chentau/marks.nvim'
Plug 'juneggun/fzf.vim'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'glepnir/dashboard-nvim', { 'on': 'Dashboard' }
"code runner

call plug#end()
lua << EOF
require'marks'.setup {
  -- whether to map keybinds or not. default true
  default_mappings = true,
  -- which builtin marks to show. default {}
  builtin_marks = { ".", "<", ">", "^" },
  -- whether movements cycle back to the beginning/end of buffer. default true
  cyclic = true,
  -- whether the shada file is updated after modifying uppercase marks. default false
  force_write_shada = true,
  -- how often (in ms) to redraw signs/recompute mark positions. 
  -- higher values will have better performance but may cause visual lag, 
  -- while lower values may cause performance penalties. default 150.
  refresh_interval = 250,
  -- sign priorities for each type of mark - builtin marks, uppercase marks, lowercase
  -- marks, and bookmarks.
  -- can be either a table with all/none of the keys, or a single number, in which case
  -- the priority applies to all marks.
  -- default 10.
  sign_priority = { lower=10, upper=15, builtin=8, bookmark=20 },
  -- disables mark tracking for specific filetypes. default {}
  excluded_filetypes = {},
  -- marks.nvim allows you to configure up to 10 bookmark groups, each with its own
  -- sign/virttext. Bookmarks can be used to group together positions and quickly move
  -- across multiple buffers. default sign is '!@#$%^&*()' (from 0 to 9), and
  -- default virt_text is "".
  bookmark_0 = {
    sign = "⚑",
    virt_text = "hello world"
  mappings = {}
" misc
set termguicolors
lua require 'colorizer'.setup()
let g:loaded_python_provider = 0
let g:python3_host_prog  = '/usr/bin/python3.9'
set background=dark " use dark mode
" set highlight duration time to 1000 ms, i.e., 1 second
let g:highlightedyank_highlight_duration = 1000
set encoding=utf-8
set tabstop=4
set softtabstop=4
set shiftwidth=4
set textwidth=79
set expandtab
set autoindent
set fileformat=unix
set signcolumn=yes
set updatetime=300
nmap <Leader>ss :<C-u>SessionSave<CR>
nmap <Leader>sl :<C-u>SessionLoad<CR>
nnoremap <silent> <Leader>fh :DashboardFindHistory<CR>
nnoremap <silent> <Leader>ff :DashboardFindFile<CR>
nnoremap <silent> <Leader>tc :DashboardChangeColorscheme<CR>
nnoremap <silent> <Leader>fa :DashboardFindWord<CR>
nnoremap <silent> <Leader>fb :DashboardJumpMark<CR>
nnoremap <silent> <Leader>cn :DashboardNewFile<CR>
let g:dashboard_default_executive='fzf'
if eval("@%") == ""

my full init.vim

  • I have no idea what bookmarks are and how they are supposed to be different than simple marks. But if you want to get rid of marks, I suppose you should remove storing them in the viminfo/shada file. And then you could run something like :delmarks a-z in an VimEnter autocommand or even :delmarks! Mar 1, 2022 at 13:30
  • Are you running vim or neovim? If the latter, then there's a bug that may be causing the marks to not persist deleted. github.com/neovim/neovim/issues/4295
    – Craig
    Jan 30 at 16:42

2 Answers 2


The marks 0 to 9 are automatically created by vim and stored in the viminfo. If you don't want that behavior add the following command to your init.vim

set viminfo+=f0

  • This command is not saving the bookmarks. Feb 28, 2022 at 11:06

I would proposes to add to your init.vim the following commands to automatically delete the number marks when you enter neovim.

autocmd VimEnter * delmarks 0-9

  • 1
    The command does not work. But when i run ``` delmarks 0-9 ``` then they work Feb 28, 2022 at 6:59
  • This still does not work. Feb 28, 2022 at 9:15
  • 1
    It works for me. I'm not sure how to help you. Maybe it is the interaction of plugins. Can you prepare a minimal init.vim that reproduce the problem? Mar 1, 2022 at 6:23
  • 1
    Added minimal init.vim Mar 1, 2022 at 7:23
  • 1
    The above fix works for the minimal but not for my full fledged init.vim Mar 1, 2022 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.