-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrcold
607 lines (532 loc) · 17.6 KB
/
.vimrcold
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
"to start neovim in true color support
"TERM=xterm-256colors NVIM_TUI_ENABLE_TRUE_COLOR=1 SHELL=/bin/bash
set nocompatible
set tabstop=2
set shiftwidth=2
set smarttab
set smartindent
set ignorecase
set smartcase
set incsearch
set nohlsearch
set expandtab
set autoread
set nofixendofline
set sessionoptions+=tabpages,globals
if has('mouse') | set mouse= | endif
if has('termguicolors') | set termguicolors | endif
if exists('&inccommand') | set inccommand=nosplit | endif
set t_8f=[38;2;%lu;%lu;%lum
set t_8b=[48;2;%lu;%lu;%lum
set noswapfile
set suffixes-=.h " remove header files from lower priority directory sort
set backspace=start,indent,eol " make backspace work like 'normal' text editors
" Terminal shell settings {{{
set t_Co=256
augroup custom_term
autocmd!
autocmd TermOpen * setlocal bufhidden=hide
augroup END
" }}}
" Neovim highlight on yank {{{
augroup highlight_on_yank
autocmd!
autocmd TextYankPost * silent! lua vim.highlight.on_yank {on_visual=false}
augroup END
" }}}
" undo settings {{{
set undofile
set undolevels=1000 "maximum number of changes that can be undone
set undoreload=10000 "maximum number lines to save for undo on a buffer reload
" }}}
syntax on
set synmaxcol=1000
let g:matchparen_insert_timeout=10
let g:scrollview_on_startup=0
augroup filetype_vim
autocmd!
autocmd FileType vim setlocal foldmethod=marker
augroup END
let $JAVA_TOOL_OPTIONS="-javaagent:/home/stanimir/bin/lombok.jar -javaagent:/home/stanimir/bin/ebean-agent.jar"
" Cyrillic support {{{
set encoding=utf8
set keymap=bulgarian-phonetic
set iminsert=0
set imsearch=0
highlight lCursor guifg=NONE guibg=Cyan
" }}}
" settings {{{
" Since I use linux, I want this
" set clipboard=unnamedplus
if has("unix")
" ----- on UNIX ask lemonade to translate line-endings
if empty($WSL_DISTRO_NAME)
if executable('gclpr')
let g:clipboard = {
\ 'name': 'gclpr',
\ 'copy': {
\ '+': 'gclpr copy',
\ '*': 'gclpr copy',
\ },
\ 'paste': {
\ '+': 'gclpr paste --line-ending lf',
\ '*': 'gclpr paste --line-ending lf',
\ },
\ 'cache_enabled': 0,
\ }
endif
else
" ---- we are inside WSL - reach out to the Windows side
if executable($HOME . '/winhome/.wsl/gclpr.exe')
let g:clipboard = {
\ 'name': 'gclpr',
\ 'copy': {
\ '+': $HOME . '/winhome/.wsl/gclpr.exe copy',
\ '*': $HOME . '/winhome/.wsl/gclpr.exe copy',
\ },
\ 'paste': {
\ '+': $HOME . '/winhome/.wsl/gclpr.exe paste --line-ending lf',
\ '*': $HOME . '/winhome/.wsl/gclpr.exe paste --line-ending lf',
\ },
\ 'cache_enabled': 0,
\ }
endif
endif
endif
set numberwidth=2
" let mapleader=" "
" }}}
" Color colomun settings {{{
augroup ColorcolumnOnlyInInsertMode
autocmd!
autocmd InsertEnter * setlocal colorcolumn=81
autocmd InsertLeave * setlocal colorcolumn=0
augroup END
" }}}
" git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
" Plugins: {{{ [347/407]
"set rtp+=$HOME/.vim/bundle/vundle/
"call vundle#rc()
"Automatic installation of vim-plug
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugUpdate | PlugInstall
endif
call plug#begin('~/.config/nvim/plugged')
" Unmanaged plugin (manually installed and updated)
" My own vim settings.
Plug 'neovim/nvim-lspconfig'
" LSP Support
" Autocompletion
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
" Plug 'saadparwaiz1/cmp_luasnip'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-nvim-lua'
" Snippets
Plug 'L3MON4D3/LuaSnip'
" Plug 'rafamadriz/friendly-snippets'
" Plug 'VonHeikemen/lsp-zero.nvim'
Plug 'jose-elias-alvarez/null-ls.nvim'
Plug 'danymat/neogen'
Plug 'nvim-lualine/lualine.nvim'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'nvim-lua/plenary.nvim'
Plug 'sindrets/diffview.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
Plug 'ibhagwan/fzf-lua', {'branch': 'main'}
Plug 'OmniSharp/omnisharp-vim'
Plug 'mfussenegger/nvim-dap'
Plug 'AndrewRadev/linediff.vim'
Plug 'mfussenegger/nvim-jdtls'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-treesitter/nvim-treesitter-textobjects'
Plug 'nvim-treesitter/playground'
Plug '~/gramic-neovim'
Plug 'p00f/nvim-ts-rainbow'
Plug 'windwp/nvim-ts-autotag'
" Plug 'grailbio/bazel-compilation-database'
Plug 'ryvnf/readline.vim'
Plug 'leafgarland/typescript-vim'
Plug 'will133/vim-dirdiff'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'junegunn/gv.vim'
Plug 'jreybert/vimagit'
Plug 'bazelbuild/vim-bazel'
Plug 'bazelbuild/vim-ft-bzl'
Plug 'ap/vim-css-color'
Plug 'mogelbrod/vim-jsonpath'
Plug 'neovim/nvim-lsp'
"Plug 'machakann/vim-highlightedyank'
Plug 'tmux-plugins/vim-tmux-focus-events'
Plug 'dstein64/nvim-scrollview'
" Plug 'roxma/vim-tmux-clipboard'
Plug 'ConradIrwin/vim-bracketed-paste'
Plug 'justinmk/vim-dirvish'
Plug 'https://github.com/benekastah/neomake.git'
Plug 'critiqjo/lldb.nvim'
"Plugin 'itchyny/lightline.vim'
Plug 'guns/xterm-color-table.vim'
"Plug 'indenthtml.vim'
Plug 'gramic/dotvim', { 'do': 'git remote add upstream [email protected]:gramic/dotvim.git' }
"Plug 'zoneprojects/dotvimprivate'
Plug 'Valloric/MatchTagAlways'
Plug 'folke/trouble.nvim'
" Plug 'Valloric/YouCompleteMe', { 'do': './install.py --clangd-completer' } " --java-completer
Plug 'p00f/clangd_extensions.nvim'
"Plug 'argtextobj.vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'pangloss/vim-javascript'
" Plug 'scrooloose/nerdcommenter'
Plug 'jpetrie/vim-counterpoint'
Plug 'ekalinin/Dockerfile.vim'
Plug 'tpope/vim-dadbod'
Plug 'tpope/vim-speeddating'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-vinegar'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-obsession'
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-characterize'
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'kristijanhusak/vim-dadbod-completion'
Plug 'kristijanhusak/vim-dadbod-ui'
Plug 'vim-scripts/dbext.vim'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'gcmt/taboo.vim'
Plug 'shumphrey/fugitive-gitlab.vim'
Plug 'mbbill/undotree'
Plug 'gregsexton/gitv'
Plug 'benjifisher/matchit.zip'
Plug 'qpkorr/vim-bufkill'
Plug 'nelstrom/vim-visual-star-search'
Plug 'ap/vim-css-color'
Plug 'duganchen/vim-soy'
" Syntaxes
Plug 'luisiacc/gruvbox-baby', {'branch': 'main'}
Plug 'sainnhe/sonokai'
Plug 'google/vim-jsonnet'
Plug 'jamessan/vim-gnupg'
Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
" Useful status updates for LSP
Plug 'j-hui/fidget.nvim',
" Add indentation guides even on blank lines
Plug 'lukas-reineke/indent-blankline.nvim'
" "gc" to comment visual regions/lines
Plug 'numToStr/Comment.nvim'
Plug 'Hoffs/omnisharp-extended-lsp.nvim'
" Add maktaba and codefmt to the runtimepath.
" (The latter must be installed before it can be used.)
Plug 'google/vim-maktaba'
Plug 'google/vim-codefmt'
" Also add Glaive, which is used to configure codefmt's maktaba flags. See
" `:help :Glaive` for usage.
Plug 'google/vim-glaive'
"Plugin 'sjl/vitality.vim'
Plug 'kazhala/close-buffers.nvim'
" Plug 'stevearc/oil.nvim'
"asyncomplete setup mappings
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>"
imap <c-space> <Plug>(asyncomplete_force_refresh)
let g:asyncomplete_auto_popup = 0
set exrc
let g:localvimrc_name=".stanimir.vimrc"
let g:localvimrc_sandbox=0
let g:typescript_indent_disable=1
" Color scheme settings {{{
filetype off
Plug 'altercation/vim-colors-solarized'
Plug 'chriskempson/base16-vim'
Plug 'morhetz/gruvbox'
Plug 'jacoborus/tender'
Plug 'lifepillar/vim-solarized8'
call plug#end()
" }}}
filetype plugin indent on
let g:highlightedyank_highlight_duration = 100
set background=light
" let g:solarized_termtrans=1
let g:solarized_termcolors=256
let base16colorspace=256 " Access colors present in 256 colorspace
"silent! colorscheme base16-tomorrow
"silent! colorscheme solarized
silent! colorscheme gruvbox
" silent! colorscheme gruvbox-baby
"silent! colorscheme tender
set background=dark
" }}}
" Calendar group. {{{
augroup fugitivegroup
let g:calendar_google_calendar = 1
let g:calendar_google_task = 1
let g:calendar_first_day = 'monday'
augroup END
" }}}
" Vim commentary group. {{{
augroup vim_commentary
autocmd FileType cpp set commentstring=//\ %s
augroup END
" }}}
" Github-issues group. {{{
let g:github_access_token = "32a5c2ba3eb003cbe99385ec400495210f38fc59"
" }}}
" Fugitive group. {{{
augroup fugitivegroup
autocmd BufReadPost fugitive://* set bufhidden=delete
augroup END
" }}}
" Taboo group. {{{
augroup taboogroup
let g:taboo_tab_format = " %N %P "
augroup END
" }}}
" Menu completions {{{
set wildmode=full wildmenu " Command-line tab completion
set infercase " AutoComplete in Vim
" set completeopt=longest,menu,menuone,preview
set completeopt=menu,menuone,noselect
set wildignore+=*.o,*.obj,*.pyc,*.DS_STORE,*.db,*.swc
" }}}
" Gui options {{{
:set guioptions=ai "remove all gui options except select copy buffer and icon
" }}}
" Movements {{{
" have the h and l cursor keys wrap between lines
" (like </space><space> and <bkspc> do by default),
" and ~ convert case over line breaks; also have the cursor keys
" wrap in insert mode:
set whichwrap=h,l,~,[,]
" }}}
" BufKill {{{
" Disable key mappings.
let g:BufKillCreateMappings = 0
" }}}
" Gitv configuration {{{
let g:Gitv_TruncateCommitSubjects = 1
" }}}
" Unite Plugin mappings {{{
"let g:unite_source_history_yank_enable = 1
"call unite#filters#matcher_default#use(['matcher_fuzzy'])
"nnoremap <leader>y :Unite history/yank<cr>
" }}}
" Generic mappings {{{
if has("nvim")
au TermOpen * tnoremap <Esc> <c-\><c-n>
" au FileType fzf tunmap <Esc>
endif
nnoremap <M-1> 1gt
nnoremap <M-2> 2gt
nnoremap <M-3> 3gt
nnoremap <M-4> 4gt
nnoremap <M-5> 5gt
" }}}
" YouCompleteMe {{{
inoremap <C-x><C-o> <Cmd>lua require('cmp').complete()<CR>
let g:ycm_key_invoke_completion = '<C-Space>'
let g:ycm_filetype_specific_completion_to_disable = {'lua':1}
" Let clangd fully control code completion
let g:ycm_clangd_uses_ycmd_caching = 0
nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>
nnoremap <leader>jy :YcmCompleter GoTo<CR>
" }}}
" gitgutter {{{
highlight clear SignColumn
let g:gitgutter_enabled = 0
" }}}
" folding {{{
" Enable bazel folding
let g:ft_bzl_fold = 1
" }}}
" codefmt {{{
if exists("*glaive#Install")
call glaive#Install()
" Optional: Enable codefmt's default mappings on the <Leader>= prefix.
Glaive codefmt plugin[mappings]
Glaive codefmt clang_format_style=Google
endif
" }}}
" General mappings {{{
"map copy to end of line
nnoremap Y y$
"Make the single quote work like a backtick
nnoremap ' `
" <C-l> redraws the screen, disable search term highlighting (don't switch it
" off) and switches of the list view option
nnoremap <silent> <C-l> :nohlsearch <bar> set nolist<CR><C-l>
if has("gui_running") && has("gui_win32")
" use alt-space for window options
nnoremap <m-space> :simalt~<CR>
endif
map ' `
" Save files with sudo rights if you forgot
:command! W w !sudo tee % > /dev/null
"wildmenu that can be used like :e <C-D>
set wildmenu
" Javascript autocommands {{{
" our style is curly brace at the end of the function signature
" Java autocommands {{{
augroup javascriptgroup
au!
autocmd BufNewFile,BufRead *.js map [[ ?function(.*)\ {$<CR>
autocmd BufNewFile,BufRead *.js map ]] /^};$<CR>
" Google js lint this file
autocmd BufNewFile,BufRead *.js map-local <C-j> :!gjslint --strict %<CR>
augroup END
" }}}
"turn omni completion on
"autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
"set tags+=~/.vim/closuretags
let g:EclimCompletionMethod = 'omnifunc'
let g:EclimMavenPomClasspathUpdate = 0
let g:EclimJavascriptValidate = 0
" Java autocommands {{{
augroup filetype_java
au!
" use this to drive eclim auto complition to YCM. Remove after the above
" is available in the next version of eclim.
autocmd Filetype java setlocal omnifunc=eclim#java#complete#CodeComplete
augroup END
" }}}
"Doxygen Toolkit settings for javascript comments {{{
let g:DoxygenToolkit_compactDoc = "yes"
let g:DoxygenToolkit_startCommentTag = "/** "
let g:DoxygenToolkit_startCommentBlock = "/* "
let g:DoxygenToolkit_briefTag_pre=""
let g:DoxygenToolkit_paramTag_pre = "@param {} "
let g:DoxygenToolkit_interCommentTag=" * "
let g:DoxygenToolkit_endCommentTag = " */"
let g:DoxygenToolkit_endCommentBlock = " */"
" }}}
" Prevent various Vim features from keeping the contents of pass(1) password {{{
" files (or any other purely temporary files) in plaintext on the system.
"
" Either append this to the end of your .vimrc, or install it as a plugin with
" a plugin manager like Tim Pope's Pathogen.
"
" Author: Tom Ryder <[email protected]>
"
" Don't backup files in temp directories or shm
set backupskip+=/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*
" Don't keep swap files in temp directories or shm
augroup swapskip
autocmd!
silent! autocmd BufNewFile,BufReadPre
\ /tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*
\ setlocal noswapfile
augroup END
" Don't keep undo files in temp directories or shm
if has('persistent_undo') && has('autocmd')
augroup undoskip
autocmd!
silent! autocmd BufWritePre
\ /tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*
\ setlocal noundofile
augroup END
endif
" }}}
" Lua config setup {{{
lua <<EOF
require('third-party-config')
-- require('neogen').setup {}
EOF
" }}}
" Command Make will call make and then cwindow which
" opens a 3 line error window if any errors are found.
" If no errors, it closes any open cwindow.
:command! -nargs=* Make make! <args>
" CtrlP mappings
let g:fzf_command_prefix = 'Fzf'
" Similarly, we can apply it to fzf#vim#grep. To use ripgrep instead of ag:
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --column --line-number --no-heading --color=always --smart-case '.shellescape(<q-args>), 1,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)
let g:ctrlp_follow_symlinks = 0
let g:ctrlp_working_path_mode = 2 " don't manage current directory
let g:ctrlp_root_markers = ['CMakeLists\.txt']
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.hg$\|\.svn$\|node_modules$\|bazel-app$\|bazel-bin$\|bazel-genfiles$\|bazel-out$\|build$\|build_release$\|build_debug$\|third_parties\|target$',
\ }
" nnoremap <localleader>ff :FzfGFiles<CR>
nnoremap <localleader>ff :FzfLua git_files<CR>
" nnoremap <localleader>fm :FzfHistory<CR>
nnoremap <localleader>fm :FzfLua oldfiles<CR>
let g:ctrlp_by_filename = 1 " search by filename (not full path) as default.
let g:ctrlp_dotfiles = 0 " do not search inside dot files and dirs.
let g:OmniSharp_translate_cygwin_wsl = 1
" Limit popup menu height
set pumheight=15
" SuperTab option for context aware completion
let g:SuperTabDefaultCompletionType = "context"
if !exists("lint_autocommand_loaded")
let lint_autocommand_loaded = 1
au FileType json setlocal equalprg=json_reformat
au BufRead *.json set filetype=json
au FileType python setlocal tabstop=4 shiftwidth=4 foldmethod=indent
au BufRead nginx.conf set filetype=nginx
au BufRead lighttpd.conf set filetype=lighttpd
au BufRead *.cpp,*.c,*.cc,*.hpp,*.h noremap <buffer> <Leader>bt :call CppRunTests("")<CR>
au BufRead *.js noremap <buffer> <Leader>l :call Jslint()<CR>
endif
function! SimpleStatusLine()
set laststatus=0
set statusline=
set statusline+=%f " relative path
set statusline+=%2*[%n%H%M%R%W]%*\ " buffer number, and flags
endfunction
function! ComplicatedStatusLine()
set laststatus=2
set statusline=
set statusline+=%<\ " cut at start
set statusline+=%2*[%n%H%M%R%W]%*\ " buffer number, and flags
set statusline+=%-40f\ " relative path
set statusline+=%= " seperate between right-left-aligned
set statusline+=%{fugitive#statusline()}\ " git branch name
set statusline+=%1*%y%*%*\ " file type
set statusline+=%10((%l/%L\ %c)%)\ " line and column
set statusline+=%P " percentage of file
endfunction
function! Preserve(command)
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
execute a:command
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
" Clean up trailing white spaces.
nmap _$ :call Preserve("%s/\\s\\+$//e")<CR>
" Format whole file.
nmap _= :call Preserve("normal gg=G")<CR>
set makeprg=bazel
" build
nnoremap <leader>bb 'Ci<up><enter>mamCG
" go to BUILD or BUILD.bazel file
nnoremap gb :lua require"gramic-bazel".find_in_bazel_build()<cr>
function! CurrentLineInfo()
lua << EOF
local linenr = vim.api.nvim_win_get_cursor(0)[1]
local curline = vim.api.nvim_buf_get_lines(
0, linenr, linenr + 1, false)[1]
print(string.format("Current line [%d] has %d bytes",
linenr, #curline))
EOF
endfunction