pos for line start cursor offset 2 char
See original GitHub issueevery line start with 2 char which is no color, and seems as start of line, while enter 0
cursor move to 3rd char and cannot move left by h
neovim version
bash
NVIM v0.4.2
Build type: Release
LuaJIT 2.0.5
vscode-neovim version
0.0.44
init.vim
" ------------------------------------------------------------
" -- Layer base config --------------------------------------------
" ------------------------------------------------------------
let $NVIM_TUI_ENABLE_TRUE_COLOR = 1
let mapleader=' '
set hlsearch
set number
set scrolloff=8
set expandtab
set sw=2
set tabstop=2
set softtabstop=2
set nocompatible " Be iMproved
set hidden
set nobackup
set nowritebackup
set cmdheight=2
set updatetime=300
set shortmess+=c
set signcolumn=yes
" ------------------------------------------------------------
" -- Layer key mapping ---------------------------------------
" ------------------------------------------------------------
" Vim Settings
nnoremap ; :
vnoremap ; :
nnoremap : ;
vnoremap : ;
nnoremap ? *
vnoremap ? *
nnoremap * ?
vnoremap * ?
nnoremap U <c-r>
vnoremap v <esc>
nnoremap <leader>y "+y<cr>
vnoremap <leader>y "+y<cr>
nnoremap <leader>p "+p<cr>
vnoremap <leader>p "+p<cr>
imap jj <esc>
imap jk <esc>
nnoremap <leader>vc :edit ~/.vimrc<CR>
nnoremap <leader>vs :so ~/.vimrc<CR>
nnoremap <leader>pp :PlugInstall<CR>
nnoremap <leader>w <c-w>
nnoremap <leader>wd :q<cr>
nnoremap <leader>jj :jumps<cr>
nnoremap <leader>mm :marks<cr>
" whichkey
nnoremap <leader>kk :WhichKey '<Space>'<CR>
vnoremap <leader>kk :WhichKey '<Space>'<CR>
" EasyMotion
map ,, <Plug>(easymotion-prefix)
map ,,s <Plug>(easymotion-s2)
map ,,/ <Plug>(easymotion-sn)
map ,,h <Plug>(easymotion-linebackward)
map ,,j <Plug>(easymotion-j)
map ,,k <Plug>(easymotion-k)
map ,,l <Plug>(easymotion-lineforward)
map ,,. <Plug>(easymotion-repeat)
" nerdtree
nnoremap <leader>ee :NERDTreeToggle<CR>
vnoremap <leader>ee :NERDTreeToggle<CR>
" coc
" Use tab for trigger completion with characters ahead and navigate.
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
" Coc only does snippet and additional edit on confirm.
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
nnoremap ,,f :CocCommand eslint.executeAutofix<cr>
nnoremap <leader>crc :CocConfig<CR>
nnoremap <leader>ca :<C-u>CocList diagnostics<cr>
nnoremap <leader>ce :<C-u>CocList extensions<cr>
nnoremap <leader>cc :<C-u>CocList commands<cr>
nnoremap <leader>co :<C-u>CocList outline<cr>
nnoremap <leader>cs :<C-u>CocList -I symbols<cr>
nnoremap <leader>cj :<C-u>CocNext<CR>
nnoremap <leader>ck :<C-u>CocPrev<CR>
nnoremap <leader>cp :<C-u>CocListResume<CR>
xmap <leader>cf <Plug>(coc-format-select)
nmap <leader>cf <Plug>(coc-format-select)
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
map <leader>ac <Plug>(coc-codeaction)
map <leader>qf <Plug>(coc-fix-current)
map gd <Plug>(coc-definition)
map gy <Plug>(coc-type-definition)
map gi <Plug>(coc-implementation)
map gr <Plug>(coc-references)
call plug#begin('~/.vim/plugged')
" ------------------------------------------------------------
" -- Layer EasyMotion ----------------------------------------
" ------------------------------------------------------------
Plug 'easymotion/vim-easymotion'
let g:EasyMotion_smartcase = 1
" ------------------------------------------------------------
" -- Layer LeaderF ------------------------------------------
" ------------------------------------------------------------
Plug 'Yggdroot/LeaderF'
" ------------------------------------------------------------
" -- Layer nerdtree ----------------------------------------
" ------------------------------------------------------------
Plug 'scrooloose/nerdtree'
let nerdtreequitonopen = 0
let NERDTreeShowHidden=0
let nerdchristmastree=1
let g:nerdtreewinsize = 25
let g:NERDTreeDirArrowExpandable = '▷'
let g:NERDTreeDirArrowCollapsible = '▼'
let NERDTreeAutoCenter=1
let g:rooter_patterns = ['.git/']
let g:nerdtreeindicatormapcustom = {
\ "modified" : "✹",
\ "staged" : "✚",
\ "untracked" : "✭",
\ "renamed" : "➜",
\ "unmerged" : "═",
\ "deleted" : "✖",
\ "dirty" : "✗",
\ "clean" : "✔︎",
\ 'ignored' : '☒',
\ "unknown" : "?"
\ }
" ------------------------------------------------------------
" -- Layer Theme -----------------------------------------------
" ------------------------------------------------------------
Plug 'liuchengxu/space-vim-dark'
Plug 'morhetz/gruvbox'
" ------------------------------------------------------------
" -- Layer Coc -----------------------------------------------
" ------------------------------------------------------------
Plug 'neoclide/coc.nvim', {'tag': '*', 'do': './install.sh'}
augroup cocgroup
autocmd!
autocmd FileType javascript,typescript,javascriptreact,typescriptreact,json setl formatexpr=CocAction('formatSelection')
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" ------------------------------------------------------------
" -- Layer startify ----------------------------------------
" ------------------------------------------------------------
Plug 'mhinz/vim-startify'
" ------------------------------------------------------------
" -- Layer whichKey ----------------------------------------
" ------------------------------------------------------------
Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] }
" ------------------------------------------------------------
" -- Layer airline ----------------------------------------
" ------------------------------------------------------------
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" ------------------------------------------------------------
" -- Layer indentLine ----------------------------------------
" ------------------------------------------------------------
Plug 'Yggdroot/indentLine'
" ------------------------------------------------------------
" -- Layer visual-multi ----------------------------------------
" ------------------------------------------------------------
Plug 'mg979/vim-visual-multi'
" ------------------------------------------------------------
" -- Layer easy-align ----------------------------------------
" ------------------------------------------------------------
Plug 'junegunn/vim-easy-align'
" ------------------------------------------------------------
" -- Layer vista ----------------------------------------
" ------------------------------------------------------------
Plug 'liuchengxu/vista.vim'
Plug 'chr4/nginx.vim'
" ------------------------------------------------------------
" -- Layer fzf ----------------------------------------
" ------------------------------------------------------------
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
call plug#end()
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to determine character offset of cursor in buffer?
I think this means, that the cursor_chars returns the number of characters up to and including the position of the cursor.
Read more >cursor new line positioning with Notepad++ - Stack Overflow
By default the cursor starts with offset matching all whitespace characters at the beginning of previous (non-empty) line, but I would like to ......
Read more >Position Info (GNU Emacs Manual)
7.9 Cursor Position Information. Here are commands to get information about the size and position of parts of the buffer, and to count...
Read more >Please display the current absolute character cursor position ...
So I can know the character at a certain position in a line, but I don't know what is the absolute character number...
Read more >notepad++ - How to know cursor position index in an editor
Select all characters from the current cursor position to the start of the file using ctrl + shift + home. Look at the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
set signcolumn=yes
this probably is causing this. You don’t need to set most standard options with vscode, and sometimes they harm 😄@charlzyx Also pretty bunch of plugins from your init.vim don’t make sense with vscode - nerdtree, leaderf, airline, coc, etc. anything involving window/buffer management probably won’t work.