todo-comments.nvim icon indicating copy to clipboard operation
todo-comments.nvim copied to clipboard

Don't understand the vim script config

Open Ross-Li opened this issue 2 years ago • 6 comments

By saying

lua << EOF
  require("todo-comments").setup {
    -- your configuration comes here
    -- or leave it empty to use the default settings
    -- refer to the configuration section below
  }
EOF

in the vim script config method, do you mean to include this code directly into the init.vim file??? It doesn't seems to work for me because the syntax highlighing suggests it can't recognize this code. Can you please add in the document about where exactly to include this code in?

image

Ross-Li avatar Sep 10 '22 13:09 Ross-Li

in init.vim or anywhere else. Just make sure this code is ran after the plugin is loaded

folke avatar Sep 10 '22 13:09 folke

@folke I have already included this code in init.vim, but the plugin doesn't work.

Ross-Li avatar Sep 10 '22 13:09 Ross-Li

Are you sure the plugin was loaded before executing this? What plugin manager are you using?

folke avatar Sep 10 '22 13:09 folke

Just vimplug, here is my init.vim

" Inspirations from the following config sources
" https://gist.github.com/synasius/5cdc75c1c8171732c817
" https://github.com/Garoth/Configs/blob/master/nvim/init.vim
" https://github.com/krisleech/neovim-config/blob/master/init.vim
" https://github.com/NeuralNine/config-files/blob/master/init.vim
" https://gist.github.com/pluskid/2de23aea09470e985a33899ed154dc95
" https://zhuanlan.zhihu.com/p/434731678

" Plugins
call plug#begin()

Plug 'https://github.com/vim-airline/vim-airline'           " Airline theme
Plug 'https://github.com/preservim/nerdtree'                " Nerdtree file explorer
Plug 'http://github.com/tpope/vim-surround'                 " Surrounding ysw
Plug 'https://github.com/tpope/vim-commentary'              " For Commenting gcc & gc
Plug 'https://github.com/rafi/awesome-vim-colorschemes'     " Some colorschemes
Plug 'https://github.com/ryanoasis/vim-devicons'            " Developer Icons
Plug 'https://github.com/tc50cal/vim-terminal'              " Vim Terminal
Plug 'https://github.com/terryma/vim-multiple-cursors'      " CTRL+N for multiple cursors
" Plug 'https://github.com/neoclide/coc.nvim'               " Auto Completion
Plug 'https://github.com/jbgutierrez/vim-better-comments'   " Better comment
Plug 'https://github.com/windwp/nvim-autopairs'             " Auto pairs
Plug 'folke/todo-comments.nvim'                             " Better comment for neovim
Plug 'nvim-lua/plenary.nvim'

call plug#end()

" Plugin Settings
    " NERDTree
nnoremap <C-f> :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
    " todo comment  

lua << EOF
  require("todo-comments").setup {
    -- your configuration comes here
    -- or leave it empty to use the default settings
    -- refer to the configuration section below
  }
EOF

" Colorscheme
:colorscheme onedark


:set nocompatible            " Disable compatibility to old-time vi

" Space & Tabs
:set tabstop=4			    " Number of visual spaces per TAB
:set softtabstop=4		    " Number of spaces in tab when editing
:set shiftwidth=4           " Number of spaces for autoindent
:set expandtab              " Tabs are spaces
:set mouse=a                " Enable mouse click
:set autoindent             " Enable autoindent
:set smarttab               " Enable smarttab

" Clipboard
set clipboard=unnamed

" UI  
set number                  " Show line number
set cursorline              " Highlight current cursorline
hi CursorLine cterm=NONE ctermbg=DarkGrey ctermfg=white
hi Comment cterm=italic gui=italic
set showcmd                 " Show command in bottom bar
set wildmenu                " Enable visual auto complete for command menu
set showmatch               " Highlight matching brace

" WSL yank support
" From https://stackoverflow.com/questions/44480829/how-to-copy-to-clipboard-in-vim-of-bash-on-windows/61864749#61864749
let s:clip = '/mnt/c/Windows/System32/clip.exe'  " default location
if executable(s:clip)
    augroup WSLYank
        autocmd!
        autocmd TextYankPost * call system('echo '.shellescape(join(v:event.regcontents, "\<CR>")).' | '.s:clip)
    augroup END
end

image

Ross-Li avatar Sep 10 '22 14:09 Ross-Li

Can you show me the file where it should highlight?

Also, you don't seem to have treesitter installed, so comments_only won't work. (you may have to disable it)

folke avatar Sep 10 '22 14:09 folke

Ahhh I see, maybe it is the absence of TreeSitter. I will have a look at it. For now the icon works. Thank you for your timely response! image

Ross-Li avatar Sep 10 '22 15:09 Ross-Li

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 06 '24 01:07 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Jul 13 '24 01:07 github-actions[bot]