michal-h21 / vimwiki-sync

Automaticaly synchronize vimwiki at startup and exit using git
98 stars 25 forks source link

User manual needed #5

Open duytientran opened 3 years ago

duytientran commented 3 years ago

Hi, sorry for noob questions/requests. Would you mind explaining how to use this plugin ? I installed it but I do not know how to use it ( I am new to Neovim). Thanks

michal-h21 commented 3 years ago

Hi, I've updated README with some basic instructions. I hope it helps.

duytientran commented 2 years ago

Thanks so much. I have configured everything as instructed. However, when I start neovim, my neovim just stop working. When I remove git from the wiki folder, things work again. Any idea ? Thanks Best regards, Tien

On Tue, Sep 7, 2021 at 10:01 PM Michal Hoftich @.***> wrote:

Hi, I've updated README with some basic instructions. I hope it helps.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/michal-h21/vimwiki-sync/issues/5#issuecomment-914244063, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQAZCNB2PVFZYIH3YI2SOLDUAX5JVANCNFSM5DRSPQHA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

michal-h21 commented 2 years ago

I am not sure. I normally use plain Vim, which works. I tried syncing in Neovim and it doesn't seem to work, but it doesn't cause crash. It seems that it isn't executed at startup and exit at all, so it is a bit strange that it causes issues for you. I will need to investigate it more.

michal-h21 commented 2 years ago

I've tested syncing with Neovim again and it works. Could you post list of the plugins you use? Maybe even your init.vim? It may be caused by some plugin clash.

duytientran commented 2 years ago

Hi, please find attached for my neovim config Best regards, Tien

On Thu, Sep 16, 2021 at 6:32 PM Michal Hoftich @.***> wrote:

I've tested syncing with Neovim again and it works. Could you post list of the plugins you use? Maybe even your init.vim? It may be caused by some plugin clash.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/michal-h21/vimwiki-sync/issues/5#issuecomment-920701510, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQAZCNELND7RACSYSVFFTM3UCGTTPANCNFSM5DRSPQHA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

michal-h21 commented 2 years ago

@duytientran sorry for the late reply, I somehow missed your update. Can you please re-send your config file? I cannot see it.

duytientran commented 2 years ago

Please find attached Best regards, Tien

On Thu, Sep 30, 2021 at 11:44 PM Michal Hoftich @.***> wrote:

@duytientran https://github.com/duytientran sorry for the late reply, I somehow missed your update. Can you please re-send your config file? I cannot see it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/michal-h21/vimwiki-sync/issues/5#issuecomment-931336120, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQAZCNCWDXA5GQFC2UQAQ53UERSS5ANCNFSM5DRSPQHA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

michal-h21 commented 2 years ago

@duytientran I am afraid that I still cannot see it. It seems that Github removed it from your mail. Could you please try to put it somewhere else?

duytientran commented 2 years ago

Hi Michal, I have copied the content here. I hope it helps. If it's not, please contact me through my g m a i l account: arenberg319. Cheers "{{{ Vim vanilla mapping let mapleader = " " "Mapping leader key " nnoremap le nnoremap so :update:source ~/.config/nvim/init.vim:nohlsearch nnoremap ss :update nnoremap sq :update:bd " nnoremap sc :setspell nnoremap su :setnospell " unmap qq " unmap QQ nnoremap qq :bd! nmap cl :nohlsearch "Clean extra space between words while ignoring noremap dws :%s/(\S)\s+(\S)/\1 \2/g:nohlsearch "Mapping s and S to delete without registering in register (register in "blackhole register) nnoremap s "_diw nnoremap S "_S nnoremap x "_x nnoremap c0 :set conceallevel=0 nnoremap c3 :set conceallevel=3 "}}}

"{{{Vim vanilla configuration set nomodeline "Ignore file’s mode lines; use vimrc configurations instead. set shell "The shell used to execute commands. let g:loaded_matchparen=1 set notimeout set nottimeout set nocompatible "Use Vim settings, rather then Vi settings. It’s important to have this on the top of your file, as it influences other options. set backspace=indent,eol,start "Allow backspacing over indention, line breaks and insertion start. set history=1000 "Set bigger history of executed commands. set showcmd "Show incomplete commands at the bottom. set showmode "Show current mode at the bottom. set autoread "Automatically re-read files if unmodified inside Vim. set hidden "Manage multiple buffers effectively: the current buffer can be “sent” to the background without writing to disk. When a background buffer becomes current again, marks and undo-history are remembered. See chapter Buffers to understand this better. set splitbelow " Horizontal splits will automatically be below set splitright " Vertical splits will automatically be to the right set clipboard=unnamedplus " Copy paste between vim and everything else set autochdir " Your working directory will always be the same as your working directory set cursorline " Enable highlighting of the current line set cmdheight=2 set lazyredraw "setting for macro set title titlestring= set isfname-== "When using commands like Ctrl-x Ctrl-f for filename completion, do not read equal signs as part of file names, a common nuisance when working with shell scripts " Display extra whitespace " set list listchars=tab:>·,trail:·,nbsp:· " Spelling check for Filetype "autocmd FileType markdown setlocal spell

"{{{ Interface configuration set conceallevel=0 set laststatus=2 "Always display the status bar. set ruler "Always show cursor position. set wildmenu "Display command line’s tab complete options as a menu. set tabpagemax=40 "Maximum number of tab pages that can be opened from the command line. set cursorline "Highlight the line currently under cursor. set number "Show line numbers on the sidebar. set relativenumber "Show line number on the current line and relative numbers on all other lines. Works only if the option above ( number ) is enabled. augroup toggle_relative_number autocmd InsertEnter :setlocal norelativenumber autocmd InsertLeave :setlocal relativenumber set noerrorbells "Disable beep on errors. set visualbell "Flash the screen instead of beeping on errors. set mouse=a "Enable mouse for scrolling and resizing. set background=dark "Use colors that suit a dark background. set title "Set the window’s title, reflecting the file currently being edited. "}}}

"{{{ Swap and backup file options "set noswapfile " set directory=$HOME/.config/nvim/swp// " set nobackup " set nowritebackup " set nowb "}}}

"{{{Indentation configuration set autoindent "New lines inherit the indentation of previous lines. filetype plugin indent on "Smart auto indentation (instead of old smartindent option). set tabstop=4 "Show existing tab with 4 spaces width. set shiftwidth=2 "When indenting with ‘>’, use 2 spaces width. set expandtab "On pressing tab, insert 4 spaces. set wrap "Don’t wrap lines. set breakindent set showbreak= "set formatoptions+=a set textwidth=100 "}}}

"{{{Search configuration set incsearch "Find the next match as we type the search. set hlsearch "Highlight searches by default. set ignorecase "Ignore case when searching . . . set smartcase "unless you type a capital. "}}}

"{{{Text rendering configuration set encoding=utf-8 "Use an encoding that supports Unicode. set linebreak "Wrap lines at convenient points, avoid wrapping a line in the middle of a word. set scrolloff=999 "The number of screen lines to keep above and below the cursor. set sidescrolloff=5 "The number of screen columns to keep to the left and right of the cursor. syntax enable "Enable syntax highlighting. "}}}

"{{{ Miscellaneous configuration set confirm "Display a confirmation dialog when closing an unsaved file. "}}}

"{{{Vim vanilla undo configuration set undodir=~/.config/nvim/undodir if has("persistent_undo") let target_path = expand('~/.config/nvim/undodir')

" create the directory and any parent directories
" if the location does not exist.
if !isdirectory(target_path)
    call mkdir(target_path, "p", 0700)
endif

let &undodir=target_path
set undofile

endif"}}}

"{{{ Vim vanilla windows navigation configuration nnoremap nnoremap nnoremap nnoremap "}}}

"{{{ Movement "Bring next or previous search results to midscreen nnoremap n 'Nn'[v:searchforward] xnoremap n 'Nn'[v:searchforward] onoremap n 'Nn'[v:searchforward] nnoremap N 'nN'[v:searchforward] xnoremap N 'nN'[v:searchforward] onoremap N 'nN'[v:searchforward] nnoremap g; nnoremap g, "}}}

"{{{Vim visual mode mapping vnoremap . :normal. " Dot command vnoremap J :m '>+1gv=gv " Move visual selection vnoremap K :m '<-2gv=gv " Move visual selection "}}}

"{{{ Vim folding configuration set foldmethod=marker "Defines the type of folding. set foldlevel=20 " Large value for opening fold when open a file let perl_fold=1 let perl_fold_blocks = 1 let sh_fold_enabled=1 let vimsyn_folding='af' let r_syntax_folding=1 let ruby_fold=1 let php_folding=1 let javascript_fold=1 let xml_syntax_folding=1 "}}}

"{{{Vim buffer mapping

noremap bd :bd " Close the buffer. " noremap :bn " Next buffer. noremap :bn " Next buffer. noremap :bp " Next buffer. " noremap nb :bn " Next buffer. " noremap pb :bp " Previous buffer. " noremap :bp " Previous buffer. noremap :b# " Toggle to most recently used buffer. "}}}

"{{{ Others "clearing registers by wipereg command! Wipereg for i in range(34,122) | silent! call setreg(nr2char(i), []) | endfor "}}}

"{{{ Vim vanilla wrap lines movement " mapping to make movements operate on 1 screen line in wrap mode function! ScreenMovement(movement) if &wrap return "g" . a:movement else return a:movement endif endfunction onoremap j ScreenMovement("j") onoremap k ScreenMovement("k") onoremap 0 ScreenMovement("0") onoremap ^ ScreenMovement("^") onoremap $ ScreenMovement("$") nnoremap j ScreenMovement("j") nnoremap k ScreenMovement("k") nnoremap 0 ScreenMovement("0") nnoremap ^ ScreenMovement("^") nnoremap $ ScreenMovement("$") "}}}

"{{{ Abbreviation Configuration let g:AutoPairsMapSpace=0 " Title: Abbreviation expansions " Author: Michael Geddes " Version: 0.1.1 " " This was created at the request of Marsha Gilliland for her work doing " Medical Transcription. " " As such, if you add an abbreviation such as wrt=with respect to " then a corresponding abbreviation Wrt=With respect to is also created. " " Usage: " :Myabbrev {abbrev} {expanded} " Add an abbreviation of {lhs} to {expanded} " use ;; to expand an abbreviation that does not already exist... eg: " typing.. " mrg ;; " will prompt for the abbreviation, and then replace mrg with whatever is " typed... as well as adding it to the persistent list for future. " " g:abbrevlist_filename This is where the abbreviations are stored. "

if ! exists('g:abbrevlist_filename') let g:abbrevlist_filename='/home/arenberg/MEGA/brain_tientran/dot_files/abbrevs.txt' endif " fun! s:AddAbbrev(lhs, rhs) exe 'iabb '.a:lhs.' '.a:rhs if a:lhs =~# '^[a-z]' && a:rhs =~# '^[a-z]' let lhs=substitute(a:lhs, '.', '\u&','') let rhs=substitute(a:rhs, '.', '\u&','') exe 'iabb '.lhs.' '.rhs endif endfun

fun! s:LoadAbbrevs(filename) for line in readfile(a:filename) let lhs=matchstr(line, '^\s\zs\k+>') let rhs=matchstr(line, '^\k+>\s+\zs.{-}\ze\s$') if lhs !~ '^\s$' && rhs !~ '^\s$' call s:AddAbbrev(lhs,rhs) endif endfor endfun

fun! s:AddAbbrevFile(filename, lhs, rhs) exe 'redir >> '.a:filename silent echo a:lhs a:rhs redir END call s:AddAbbrev(a:lhs,a:rhs) endfun

fun! s:AddMyAbbrev(myab) let lhs=matchstr(a:myab,'^\S+') let rhs=matchstr(a:myab,'^\S+\s+\zs.{-}\ze\s$') if rhs =~ '^\s$' echoerr 'Supply abbreviation and expanded text' else if lhs == '.' let lhs=expand('') if lhs == '' echoerr 'No word under cursor' return endif endif call s:AddAbbrevFile(expand(g:abbrevlist_filename),lhs,rhs) endif endfun

" use Myabbrev {lhs} {rhs} to add an abbreviation com! -nargs=+ Myabbrev call s:AddMyAbbrev()

" Used by ;; abbreviation to trigger adding an abbreviation fun! s:InputAbbrev(abblen) " Gobble the character let ch=nr2char(getchar()) let c=col('.')-(2+a:abblen) let line=getline('.') " Find the end while c > 0 if line[c] =~ '\k' | break | endif let c-=1 endwhile " Find the start let b=c-1 while b>=0 if line[b] !~ '\k' | break | endif let b -= 1 endwhile let lhs = line[b+1:c] " Prompt for the expansion let rhs=input(lhs.' expands to>') if rhs=='' return (ch == ' ')?'':ch else call s:AddAbbrevFile(expand(g:abbrevlist_filename),lhs,rhs) return repeat("\",(col('.')-b)-(2+a:abblen)).rhs.ch endif endfun " " If the abbreviation is not recognized - use ;; to trigger to prompt for the " required expansion. iabbrev ;;; InputAbbrev(2)

if filereadable(expand(g:abbrevlist_filename)) " Load the file if it exists call s:LoadAbbrevs(expand(g:abbrevlist_filename)) else echo 'Loading defaults' " This is an example of usage - and sets up the defaults. Myab tp the patient Myab IMP IMPRESSION: endif "}}}

"{{{ Vim Insert Mode Mapping imap :w imap "+p imap g- " imap " imap " imap " imap " imap d$ " imap d$ " imap A:nohlsearch cannot map due to default behavior imap I:nohlsearch imap A:nohlsearch imap Ea imap cE " imap B "Modify Ctr-Y in insert mode which copies above word instead of character on the "above line inoremap pumvisible() ? "\" : matchstr(getline(line('.')-1), '\%' . virtcol('.') . 'v\%(\k+\|.)') "Modify Ctr-E in insert mode which copies above word instead of character on the "below line " inoremap pumvisible() ? "\" : matchstr(getline(line('.')+1), '\%' . virtcol('.') . 'v\%(\k+\|.)') "}}}

"{{{ Vim plugin list call plug#begin() Plug 'tpope/vim-repeat' " Work with vim-surround plugin. Just need to press . it will repeat the last action Plug 'tpope/vim-surround' " Surround with brackets,... Plug 'kreskij/Repeatable.vim', { 'on': 'Repeatable' } " Put Repeatable before mapping to make it repeatable. Plug 'sedm0784/vim-you-autocorrect' " Autocorrect words as we type, it would make English better. Plug 'ron89/thesaurus_query.vim' " Thesaurus dictionary for vim Plug 'jalvesaq/zotcite' Plug 'romainl/vim-qf' " Quickfix window control Plug 'vim-scripts/Rename2' " Rename the file Plug 'mbbill/undotree' "Undotree Plug 'arthurxavierx/vim-caser' " Change case for words Plug 'sainnhe/everforest' Plug 'joshdick/onedark.vim' " Theme for vim Plug 'vim-airline/vim-airline' " Status line for vim Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} Plug 'prettier/vim-prettier', {'do': 'yarn install'} " Make format prettier Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' Plug 'tpope/vim-commentary' " Comment vim Plug 'frazrepo/vim-rainbow' Plug 'jiangmiao/auto-pairs' Plug 'mhinz/vim-startify' Plug 'ryanoasis/vim-devicons' Plug 'junegunn/vim-peekaboo' Plug 'SirVer/ultisnips' Plug 'honza/vim-snippets' " Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'easymotion/vim-easymotion' Plug 'haya14busa/vim-easyoperator-phrase' Plug 'haya14busa/vim-easyoperator-line' " Plug 'tomasiser/vim-code-dark' " Plug 'rderik/vim-markdown-toc', { 'branch': 'add-anchors-to-headings/drc2r' } " Plug 'vim-airline/vim-airline-themes' "-----------Git---------- "Plug 'airblade/vim-gitgutter' "Plug 'mhinz/vim-signify' "Plug 'tpope/vim-fugitive' "Plug 'tpope/vim-rhubarb' "Plug 'junegunn/gv.vim' "--------------------------- Plug 'mracos/mermaid.vim' " Support mermaid syntax for vim https://support.typora.io/Draw-Diagrams-With-Markdown/ Plug 'dhruvasagar/vim-table-mode' " For creating tables Plug 'plasticboy/vim-markdown' Plug 'mzlogin/vim-markdown-toc' " Plug 'vimwiki/vimwiki', {'branch': 'dev'} Plug 'vimwiki/vimwiki' " Plug 'michal-h21/vim-zettel' Plug 'mattn/calendar-vim' " Plug 'yazgoo/yank-history' Plug 'tibabit/vim-templates' " Plug 'michal-h21/vimwiki-sync' " Plug 'masukomi/vim-markdown-folding' Plug 'preservim/tagbar' "--------Language packs------ "Plug 'elzr/vim-json' Plug 'rhysd/reply.vim', { 'on': ['Repl', 'ReplAuto'] } " Plug '/Nvim-R', {'branch': 'stable'} " Plug 'gaalcaras/ncm-R' "-------------------------------- Plug 'dkarter/bullets.vim' " For using bullets, number indents Plug 'ntpeters/vim-better-whitespace' " For controlling whitespace Plug 'matze/vim-move' " For moving text Plug 'dpelle/vim-LanguageTool' " Checking gramar and vocabulary Plug 'kshenoy/vim-signature' " Marking the file and move to marks Plug 'chrisbra/Recover.vim' " For controlling swapfile Plug 'junegunn/vim-easy-align' " Aligning texts Plug 'jremmen/vim-ripgrep' " Ripgrep for vim Plug 'stefandtw/quickfix-reflector.vim' " Change directly on quickfix list Plug 'roosta/fzfolds.vim' " Fzf for folds " Plug 'Yggdroot/LeaderF', { 'do': ':LeaderfInstallCExtension' } " Plug 'nvim-lua/plenary.nvim' " Plug 'nvim-lua/popup.nvim' " Plug 'windwp/nvim-spectre' " Plug 'kyazdani42/nvim-web-devicons' " Plug 'brooth/far.vim' " requires "---Lua plugins------ Plug 'kyazdani42/nvim-web-devicons' " for file icons Plug 'kyazdani42/nvim-tree.lua' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'lukas-reineke/indent-blankline.nvim' Plug 'neovim/nvim-lspconfig' Plug 'glepnir/lspsaga.nvim' Plug 'ray-x/lsp_signature.nvim' " Plug 'nvim-lua/completion-nvim' " Plug 'hrsh7th/nvim-cmp' " Plug 'hrsh7th/cmp-buffer' " Plug 'hrsh7th/cmp-nvim-lua' " Plug 'hrsh7th/vim-vsnip' " Plug 'hrsh7th/vim-vsnip-integ' Plug 'hrsh7th/nvim-compe' Plug 'lervag/wiki.vim' call plug#end() "}}}

"{{{ Fzf folds Plugin nnoremap jf :Folds let g:fzfolds_open = 1 "}}}

"{{{ Tagbar plugin nmap tb :TagbarToggle "}}} " "{{{ Spectre plugin "nnoremap S :lua require('spectre').open()

"search current word "nnoremap sw :lua require('spectre').open_visual({select_word=true}) "vnoremap s :lua require('spectre').open_visual() "Search in current file "nnoremap sp viw:lua require('spectre').open_file_search() "}}}

"{{{ NNN Plugin

let g:nnn#set_default_mappings = 0 " Disable default mappings " Start nnn in the current file's directory " nnoremap nn :NnnPicker '%:p:h' " Opens the nnn window in a split let g:nnn#layout = 'vnew' " or vnew, tabnew etc. " Or pass a dictionary with window size let g:nnn#layout = { 'right': '~30%' } " or right, up, down " Floating window (neovim latest and vim with patch 8.2.191) "let g:nnn#layout = { 'window': { 'width': 0.9, 'height': 0.6, 'highlight': 'Debug' } } "}}}

"{{{ FZF Plugin " Always enable preview window on the right with 60% width " let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.9 } } let g:fzf_layout = { 'down':'40%'} let g:fzf_preview_window = 'right:50%' function! RipgrepFzf(query, fullscreen) let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case -- %s || true' let initial_command = printf(command_fmt, shellescape(a:query)) let reload_command = printf(command_fmt, '{q}') let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]} call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen) endfunction command! -nargs= -bang RG call RipgrepFzf(, 0) command! -bang -nargs=? -complete=dir Files \ call fzf#vim#files(, {'options': ['--layout=reverse', '--info=inline', '--preview', '~/.config/nvim/plugged/fzf.vim/bin/preview.sh {}']}, 0) nmap fF :Files~ nmap ff :Files nmap fb :Buffers nmap ft :BTags nmap fT :Tags nmap fl :BLines nmap fL :Lines nmap f' :Marks nmap fr :Rg nmap fR :RG nmap fh :History nmap fH :History/ nmap fc :History: nmap fC :Commands: nmap fk :Maps " nmap kt (fzf-maps-i) " nmap kl (fzf-maps-x) nmap fG :Commits nmap fg :BCommits nmap fs :Snippets nmap fe :Filetypes nmap (fzf-maps-n) xmap (fzf-maps-x) omap (fzf-maps-o) " imap (fzf-complete-word) " imap (fzf-complete-file) imap (fzf-complete-path) imap (fzf-complete-buffer-line) " imap (fzf-complete-line) " inoremap fzf#vim#complete#path('fd') " Path completion with custom source command inoremap fzf#vim#complete#path('rg --files') " Word completion with custom spec with popup layout option " inoremap fzf#vim#complete#word({'window': { 'width': 0.5, 'height': 0.9, 'xoffset': 1 }}) " inoremap fzf#vim#complete({'source': map(complete_info().items, "v:val.word")}) " Global line completion (not just open buffers. ripgrep required.) inoremap fzf#vim#complete(fzf#wrap({ \ 'prefix': '^.$', \ 'source': 'rg -n ^ --color always', \ 'options': '--ansi --delimiter : --nth 3..', \ 'reducer': { lines -> join(split(lines[0], ':\zs')[2:], '') }}))

function! RipgrepFzf(query, fullscreen) let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case -- %s || true' let initial_command = printf(command_fmt, shellescape(a:query)) let reload_command = printf(command_fmt, '{q}') let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]} call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen) endfunction

command! -nargs=* -bang RG call RipgrepFzf(, 0) "}}}

"{{{ Airline Plugin let g:airline_powerline_fonts = 1 let g:airline#extensions#fzf#enabled = 1 let g:airline_extensions = ['branch', 'hunks', 'coc', 'tabline'] let g:airline#extensions#tabline#formatter = 'unique_tail_improved' let g:airline#extensions#tabline#buffer_nr_show = 1 let g:airline#extensions#default#layout = [['a', 'b', 'c'], ['x', 'z', 'warning', 'error']] let g:airline_skip_empty_sections = 1 let airline#extensions#coc#stl_format_err = '%E{[%e(#%fe)]}' let airline#extensions#coc#stl_format_warn = '%W{[%w(#%fw)]}' " Configure error/warning section to use coc.nvim let g:airline_section_error = '%{airline#util#wrap(airline#extensions#coc#get_error(),0)}' let g:airline_section_warning = '%{airline#util#wrap(airline#extensions#coc#get_warning(),0)}' "let g:airline_theme = '' "}}}

"{{{ Markdown TOC Plugin " let g:vmt_insert_anchors = 1 let g:vmt_auto_update_on_save = 1 let g:vmt_cycle_list_item_markers = 0 let g:vmt_list_item_char = "*" let g:vmt_include_headings_before = 0 "}}}

"{{{ Plugin Markdown Preview nnoremap pm :MarkdownPreview let g:mkdp_auto_start = 0 let g:mkdp_auto_close = 1 let g:mkdp_refresh_slow = 0 let g:mkdp_command_for_global = 0 let g:mkdp_open_to_the_world = 0 let g:mkdp_open_ip = '' let g:mkdp_browser = '' let g:mkdp_echo_preview_url = 0 let g:mkdp_browserfunc = '' let g:mkdp_preview_options = { \ 'mkit': {}, \ 'katex': {}, \ 'uml': {}, \ 'maid': {}, \ 'disable_sync_scroll': 0, \ 'sync_scroll_type': 'middle', \ 'hide_yaml_meta': 1, \ 'sequence_diagrams': {}, \ 'flowchart_diagrams': {}, \ 'content_editable': v:false \ } let g:mkdp_markdown_css = '' let g:mkdp_highlight_css = '' let g:mkdp_port = '' let g:mkdp_page_title = '「${name}」' "}}}

"{{{ Vim Markdown Plugin " Display TOC on quickfix nnoremap tc :Toc let g:vim_markdown_folding_level = 6 " To disable conceal regardless of conceallevel setting, add the following to your .vimrc: " let g:vim_markdown_conceal = 0 " Allow for the TOC window to auto-fit when it's possible for it to shrink. It never increases its default size (half screen), it only shrinks. let g:vim_markdown_toc_autofit = 1 " Disable math conceal with Latex math syntax enabled " let g:tex_conceal = "" " let g:vim_markdown_math = 1 "}}}

"{{{ Ultisnips Plugin " Trigger configuration. Do not use if you use https://github.com/Valloric/YouCompleteMe. let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" let g:UltiSnipsListSnippets= "" " If you want :UltiSnipsEdit to split your window. let g:UltiSnipsEditSplit="normal" let g:UltiSnipsSnippetDirectories=['/home/arenberg/MEGA/resource_tientran/linux_tool/snippet/'] nnoremap se :UltiSnipsEdit nnoremap sa :UltiSnipsAddFiletypes "}}}

"{{{ Rainbow Plugin let g:rainbow_active = 1

let g:rainbow_load_separately = [ \ [ '' , [['(', ')'], ['[', ']'], ['{', '}']] ], \ [ '.tex' , [['(', ')'], ['[', ']']] ], \ [ '.cpp' , [['(', ')'], ['[', ']'], ['{', '}']] ], \ [ '.{html,htm}' , [['(', ')'], ['[', ']'], ['{', '}'], ['<\a[^>]>', '</[^>]>']] ], \ ]

let g:rainbow_guifgs = ['RoyalBlue3', 'DarkOrange3', 'DarkOrchid3', 'FireBrick'] let g:rainbow_ctermfgs = ['lightblue', 'lightgreen', 'yellow', 'red', 'magenta'] "}}}

"{{{ Autopair Plugin let g:AutoPairsFlyMode = 0 let g:AutoPairsShortcutBackInsert = '' "}}}

"{{{ Commentaryy Plugin autocmd FileType markdown setlocal commentstring= "}}}

"{{{ Vimwiki Plugin filetype plugin on syntax on let g:vimwiki_filetypes = ['markdown'] " let g:vimwiki_listsyms = '✗○◐●✓' let g:vimwiki_global_ext = 0 let g:vimwiki_ext2syntax = {'.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'} let g:vimwiki_list = [{'path': '~/MEGA/', 'syntax': 'markdown', 'ext': '.md', 'auto_generate_tags': 1, 'index': 'mega_index', 'name': 'Mega Wiki'}]

" This is to get back the C-I in jumping list nmap VimwikiNextLink nnoremap rt :VimwikiRebuildTags nnoremap gt :VimwikiRebuildTags:VimwikiGenerateTagLinks " Better to use ripgrep/fzf search rather than vimwiki search which is quite " slow " nnoremap st :VimwikiSearchTags " nnoremap sl :VimwikiSearch nnoremap gl :VimwikiGenerateLinks nnoremap vc :VimwikiCheckLinks nnoremap vt :VimwikiTOC nnoremap bl :VimwikiBacklinks command! Diary VimwikiDiaryIndex augroup vimwikigroup autocmd! " automatically update links on read diary autocmd BufRead,BufNewFile diary.md VimwikiDiaryGenerateLinks augroup end "}}}

""{{{ Zettel Plugin " let g:zettel_fzf_command = "rg --column --line-number --ignore-case --no-heading --color=always" " let g:zettel_fzf_options = ['--exact', '--tiebreak=end'] " let g:zettel_options = [{"template" : "~/MEGA/brain_tientran/dot_files/zettel_template.tpl"}] " " let g:nv_search_paths = ['~/MEGA/'] " let g:zettel_default_mappings = 0 " let g:zettel_format = "%raw_title" " " let g:zettelformat = "%y%m%d%H%M%title" " "let g:zettel_fzf_command = "rg--column --line-number --ignore-case \ --no-heading --color=always " """ let g:wiki_root = '~/Downloads/testing/' " let g:zettel_backlinks_title = "Backlinks" " let g:zettel_link_format="%title" " " imap [[ [[ZettelSearchMap " nmap zy ZettelYankNameMap " nmap zl ZettelReplaceFileWithLink " nnoremap zs :ZettelSearch " nnoremap zo :ZettelOpen " nnoremap zI :ZettelInbox " nnoremap zi :ZettelInsertNote " nnoremap zn :ZettelNew " nnoremap zgl :VimwikiRebuildTags:ZettelGenerateLinks " nnoremap ts :VimwikiSearchTags " nnoremap zbl :VimwikiRebuildTags:ZettelBackLinks " nnoremap vs :VimwikiSearch " imap [[ [[ZettelSearchMap " xmap zm ZettelNewSelectedMap " nnoremap zgt :VimwikiRebuildTags:ZettelGenerateTags ""}}}

"{{{ Easymotion Plugins and Accesories let g:EasyMotion_do_mapping = 0 " Disable default mappings map / (easymotion-sn) omap / (easymotion-tn) let g:EasyMotion_smartcasea= 1 hi Search ctermbg=Yellow map f (easymotion-bd-f) nmap wf (easymotion-overwin-f) map t (easymotion-bd-t) map ej (easymotion-bd-jk) map ek (easymotion-eol-k) let g:EasyOperator_line_do_mapping = 0 map el (easyoperator-line-select) " nmap l (easyoperator-line-select) " omap l (easyoperator-line-select) " xmap l (easyoperator-line-select) " nmap dl (easyoperator-line-delete) " nmap yl (easyoperator-line-yank) "unmap s let g:EasyOperator_phrase_do_mapping = 0 map ep (easyoperator-phrase-select) " nmap p (easyoperator-phrase-select) " omap p (easyoperator-phrase-select) " xmap p (easyoperator-phrase-select) " nmap dp (easyoperator-phrase-delete) " nmap yp (easyoperator-phrase-yank) "}}}

"{{{ Whitespace Plugin ""To enable highlighting and stripping whitespace on save by default, use respectively let g:better_whitespace_enabled=0 let g:strip_whitespace_on_save=1 ""Ignore filetype let g:better_whitespace_filetypes_blacklist=[ 'markdown', 'text', 'vimwiki', 'diff', 'gitcommit', 'unite', 'qf', 'help'] "To strip white lines at the end of the file when stripping whitespace let g:strip_whitelines_at_eof=1 "Show before tabs let g:show_spaces_that_precede_tabs=0 let g:strip_whitespace_confirm=0 "" highlight whitespace in markdown files, though stripping remains disabled by the blacklist " autocmd FileType markdown EnableWhitespace "" Do not modify kernel files, even though their type is not blacklisted and highlighting is enabled autocmd BufRead /usr/src/linux* DisableStripWhitespaceOnSave "}}}

"{{{ Tabular plugin " call the :tabularize command each time you insert a | character inoremap :call align()a function! s:align() let p = '^\s|\s.\s|\s$' if exists(':tabularize') && getline('.') =~# '^\s|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) let position = strlen(matchstr(getline('.')[0:col('.')],'.|\s\zs.')) tabularize/|/l1 normal! 0 call search(repeat('[^|]|',column).'\s{-}'.repeat('.',position),'ce',line('.')) endif endfunction "}}}

"{{{ Vim Easy Align Plugin " Start interactive EasyAlign in visual mode (e.g. vipga) xmap ga (EasyAlign) " Start interactive EasyAlign for a motion/text object (e.g. gaip) nmap ga (EasyAlign) "}}}

"{{{ Bullet Plugin let g:bullets_checkbox_markers = ' ○◐●✓' let g:bullets_enabled_file_types = ['markdown', 'text', 'gitcommit', 'wiki'] "}}}

"{{{ LanguageTool Plugin "Set symlinks file en.utf-8.add to file ignore.txt of LanguageTool to add ignore "list. If we use set spell in vim we can use [s or ]s and zg to add to the "ignore list let g:languagetool_jar= '/home/arenberg/MEGA/resource_tientran/linux_tool/LanguageTool-5.0/languagetool-commandline.jar' set spelllang=en_us nnoremap lc :LanguageToolCheck nnoremap ll :LanguageToolClear set spellfile=$HOME/MEGA/brain_tientran/dot_files/en.utf-8.add hi LanguageToolGrammarError guisp=blue gui=undercurl guifg=NONE guibg=NONE ctermfg=white ctermbg=blue term=underline cterm=none hi LanguageToolSpellingError guisp=red gui=undercurl guifg=NONE guibg=NONE ctermfg=white ctermbg=red term=underline cterm=none "}}}

"{{{ Startify Plugin let g:startify_session_autoload = 1 let g:startify_session_delete_buffers = 1 let g:startify_change_to_vcs_root = 1 let g:startify_fortune_use_unicode = 1 let g:startify_enable_special = 0 let g:startify_lists = [ \ { 'type': 'files', 'header': [' Files'] }, \ { 'type': 'dir', 'header': [' Current Directory '. getcwd()] }, \ { 'type': 'sessions', 'header': [' Sessions'] }, \ { 'type': 'bookmarks', 'header': [' Bookmarks'] }, \ ] let g:startify_bookmarks = [ \ { 'b': '~/Dropbox/brain_tientran/' }, \ { 'd': '~/Downloads' }, \ { 'v': '~/.config/nvim/init.vim' }, \ ] "}}}

"{{{ Prettier Plugin nmap py (Prettier) " Allow auto formatting for files without @." or @." tag let g:prettier#autoformat_require_pragma = 0 "}}}

""{{{ Move up and down navigation " inoremap pumvisible() ? "\" : "\" " inoremap pumvisible() ? "\" : "\" ""}}} "{{{ COC-snippets " imap (coc-snippets-expand) " vmap (coc-snippets-select) " Use for jump to next placeholder, it's default of coc.nvim " let g:coc_snippet_next = ''

" Use for jump to previous placeholder, it's default of coc.nvim " let g:coc_snippet_prev = '' " inoremap " \ pumvisible() ? coc#_select_confirm() : " \ coc#expandableOrJumpable() ? "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : " \ check_back_space() ? "\" : " \ coc#refresh()

" function! s:check_back_space() abort " let col = col('.') - 1 " return !col || getline('.')[col - 1] =~# '\s' " endfunction

" let g:coc_snippet_next = ''" inoremap " \ pumvisible() ? "\" : " \ check_back_space() ? "\" : " \ coc#refresh()

" inoremap " \ pumvisible() ? "\" : " \ check_back_space() ? "\" : " \ coc#refresh()

" function! s:check_back_space() abort " let col = col('.') - 1 " return !col || getline('.')[col - 1] =~# '\s' " endfunction "}}} "{{{ COC-explorer " Add this into coc-settings.json " // explorer "explorer.width": 30, "explorer.icon.enableNerdfont": true, "explorer.previewAction.onHover": false, "explorer.keyMappings": { "": ["expandable?", "expand", "open"], "v": "open:vsplit" "}} " nmap ce :CocCommand explorer " nmap f :CocCommand explorer --preset floating " autocmd BufEnter * if (winnr("$") == 1 && &filetype == 'coc-explorer') | q | endif "}}} ""{{{ COC-Actions "" Remap for do codeAction of selected region "function! s:cocActionsOpenFromSelected(type) abort " execute 'CocCommand actions.open ' . a:type "endfunction "xmap a :execute 'CocCommand actions.open ' . visualmode() "nmap a :set operatorfunc=cocActionsOpenFromSelectedg@ ""}}} ""{{{ COC-General "nmap cc :CocConfig "nmap ol :CocList "" nnoremap yy :CocList -A --normal yank "" nnoremap yc :CocCommand yank.clean "" nnoremap rw :CocCommand document.renameCurrentWord "nnoremap es :CocCommand snippets.editSnippets "nnoremap eo :CocCommand snippets.openSnippetFiles " nnoremap bt :CocCommand bookmark.toggle " nnoremap ba :CocCommand bookmark.annotate " nnoremap bk :CocCommand bookmark.prev " nnoremap bj :CocCommand bookmark.next " nnoremap bc :CocCommand bookmark.clearForCurrentFile " nnoremap bd :CocCommand bookmark.clearForAllFiles "}}}

"{{{ Vim-Tmux Navigation Plugin " Write all buffers before navigating from Vim to tmux pane " let g:tmux_navigator_save_on_switch = 2" " Disable tmux navigator when zooming the Vim pane let g:tmux_navigator_disable_when_zoomed = 1 " Save all vim files when vim focus lost, leave buffer and resize windows. This is for tmux. :autocmd BufLeave,FocusLost,VimResized * silent! wall "}}}

"{{{ Calendar Plugin " let g:calendar_diary='~/MEGA/diary/' let g:calendar_no_mappings=0 let g:calendar_monday = 1 let g:calendar_weeknm = 1 " WK01 nnoremap cr :Calendar " let g:calendar_filetype = 'markdown' " let g:calendar_number_of_months = 5 "}}}

"{{{ Vim-table mode plugin " Markdown and rest automatically configur " For Markdown format " let g:table_mode_corner='|' " Rest-compatible table use " let g:table_mode_corner_corner='+' " let g:table_mode_header_fillchar='=' " For excel coverting: xnoremap ec :'[,']Tableize/\t "}}}

"{{{ Undotree Plugin "Mapping F5 to toggle undo tree nnoremap :UndotreeToggle "}}}

"{{{ Quickfix Configuration command! Vlist botright vertical copen | vertical resize 50 nnoremap v :Vlist " Make :grep use ripgrep " if executable("rg") " set grepprg=rg\ --vimgrep\ --no-heading " " set grepformat=%f:%l:%c:%m,%f:%l:%m " endif "}}}

"{{{ Quickfix vimqf plugin nmap io (qf_qf_switch) nmap it (qf_qf_toggle) nmap is (qf_qf_toggle_stay) nmap ip (qf_qf_previous) nmap in (qf_qf_next) nmap op (qf_loc_previous) nmap on (qf_loc_next) nmap ot (qf_loc_toggle) nmap os (qf_loc_toggle_stay) " nmap (qf_loc_toggle_stay)

nmap { (qf_previous_file) nmap } (qf_next_file) nmap (qf_older) nmap (qf_newer) let g:qf_window_bottom = 0 let g:qf_loclist_window_bottom = 0 let g:qf_mapping_ack_style = 1 " s - open entry in a new horizontal window " v - open entry in a new vertical window " t - open entry in a new tab " o - open entry and come back " O - open entry and close the location/quickfix window " p - open entry in a preview window " let g:qf_max_height = 12 "}}}

"{{{ Thesaurus Plugin nnoremap sn :ThesaurusQueryReplaceCurrentWord vnoremap sn y:ThesaurusQueryReplace " "}}}

"{{{ Vim Theme Onedark Configuration let g:airline_theme = 'onedark' hi Comment cterm=italic let g:onedark_hide_endofbuffer=1 let g:onedark_terminal_italics=1 let g:onedark_termcolors=256 " checks if your terminal has 24-bit color support if (has("termguicolors")) set termguicolors hi LineNr ctermbg=NONE guibg=NONE endif " onedark.vim override: Don't set a background color when running in a terminal; if (has("autocmd") && !has("gui_running")) augroup colorset autocmd! let s:white = { "gui": "#ABB2BF", "cterm": "145", "cterm16" : "7" } autocmd ColorScheme * call onedark#set_highlight("Normal", { "fg": s:white }) " bg will not be styled since there is no bg setting augroup END endif

"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux. "If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support "(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.) if (empty($TMUX)) if (has("nvim")) "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198

let $NVIM_TUI_ENABLE_TRUE_COLOR=1 endif "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 > "Based on Vim patch 7.4.1770 (guicolors option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd > " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 > if (has("termguicolors")) set termguicolors endif endif syntax on colorscheme onedark "}}}

"{{{ Everforest colorscheme plugin ""Important!! "if has('termguicolors') " set termguicolors "endif "" For dark version. "set background=dark "" For light version. "" set background=light "" Set contrast. "" This configuration option should be placed before colorscheme everforest. "" Available values: 'hard', 'medium'(default), 'soft' "let g:everforest_background = 'hard' "colorscheme everforest "}}}

"{{{ Additional Configuration " Replace space with underscore map sr :s/\%V /_/g " Use function NormLead for executing Leader inside command line function! ExecuteLeader(suffix) let l:leader = get(g:,"mapleader","\")

if l:leader == ' ' let l:leader = '1' . l:leader endif

execute "normal ".l:leader.a:suffix endfunction

command! -nargs=1 NormLead call ExecuteLeader()

function! s:DiffWithSaved() let filetype=&ft diffthis vnew | r # | normal! 1Gdd diffthis exe "setlocal bt=nofile bh=wipe nobl noswf ro ft=" . filetype endfunction com! DiffSaved call s:DiffWithSaved()

"}}}

"{{{"Vim you autocorrect plugin nnoremap ae :EnableAutocorrect nnoremap ad :DisableAutocorrect "}}}

"{{{ Repeatable and vim repeat plugin " Repeatable plugin: Add Repeat in front of the mapping you want it to repeat. " vim.repeat plugin: repeat last work with . command "}}}

"{{{ vim-ripgrep plugin "Set smartcase search for ripgrep let g:rg_command = 'rg --vimgrep -S' let g:rg_highlight = 'True' "}}} "{{{ Reply vim plugin noremap ra :ReplAuto Repeatable noremap rs :ReplSend noremap rS :ReplStop noremap rR :ReplRecv noremap rl :Repl "}}}

"{{{Plugin Management Keymaps nnoremap pi :PlugInstall nnoremap pu :PlugUpdate nnoremap pc :PlugClean "}}}

"{{{ Nvim tree setup plugin let g:nvim_tree_side = 'left' "left by default let g:nvim_tree_width = 40 "30 by default, can be width_in_columns or 'width_in_percent%' let g:nvim_tree_ignore = [ '.git', 'node_modules', '.cache' ] "empty by default let g:nvim_tree_gitignore = 1 "0 by default let g:nvim_tree_auto_open = 1 "0 by default, opens the tree when typing vim $DIR or vim let g:nvim_tree_auto_close = 1 "0 by default, closes the tree when it's the last window let g:nvim_tree_auto_ignore_ft = [ 'startify', 'dashboard' ] "empty by default, don't auto open tree on specific filetypes. let g:nvim_tree_quit_on_open = 1 "0 by default, closes the tree when you open a file let g:nvim_tree_follow = 1 "0 by default, this option allows the cursor to be updated when entering a buffer let g:nvim_tree_indent_markers = 1 "0 by default, this option shows indent markers when folders are open let g:nvim_tree_hide_dotfiles = 1 "0 by default, this option hides files and folders starting with a dot . let g:nvim_tree_git_hl = 1 "0 by default, will enable file highlight for git attributes (can be used without the icons). let g:nvim_tree_highlight_opened_files = 1 "0 by default, will enable folder and file icon highlight for opened files/directories. let g:nvim_tree_root_folder_modifier = ':~' "This is the default. See :help filename-modifiers for more options let g:nvim_tree_tab_open = 1 "0 by default, will open the tree when entering a new tab and the tree was previously open let g:nvim_tree_auto_resize = 0 "1 by default, will resize the tree to its saved width when opening a file let g:nvim_tree_disable_netrw = 0 "1 by default, disables netrw let g:nvim_tree_hijack_netrw = 0 "1 by default, prevents netrw from automatically opening when opening directories (but lets you keep its other utilities) let g:nvim_tree_add_trailing = 1 "0 by default, append a trailing slash to folder names let g:nvim_tree_group_empty = 1 " 0 by default, compact folders that only contain a single folder into one node in the file tree let g:nvim_tree_lsp_diagnostics = 1 "0 by default, will show lsp diagnostics in the signcolumn. See :help nvim_tree_lsp_diagnostics let g:nvim_tree_disable_window_picker = 1 "0 by default, will disable the window picker. let g:nvim_tree_hijack_cursor = 0 "1 by default, when moving cursor in the tree, will position the cursor at the start of the file on the current line let g:nvim_tree_icon_padding = ' ' "one space by default, used for rendering the space between the icon and the filename. Use with caution, it could break rendering if you set an empty string depending on your font. let g:nvim_tree_symlink_arrow = ' >> ' " defaults to ' ➛ '. used as a separator between symlinks' source and target. let g:nvim_tree_update_cwd = 1 "0 by default, will update the tree cwd when changing nvim's directory (DirChanged event). Behaves strangely with autochdir set. let g:nvim_tree_respect_buf_cwd = 1 "0 by default, will change cwd of nvim-tree to that of new buffer's when opening nvim-tree. let g:nvim_tree_window_picker_exclude = { \ 'filetype': [ \ 'packer', \ 'qf' \ ], \ 'buftype': [ \ 'terminal' \ ] \ } " Dictionary of buffer option names mapped to a list of option values that " indicates to the window picker that the buffer's window should not be " selectable. let g:nvim_tree_special_files = { 'README.md': 1, 'Makefile': 1, 'MAKEFILE': 1 } " List of filenames that gets highlighted with NvimTreeSpecialFile let g:nvim_tree_show_icons = { \ 'git': 1, \ 'folders': 1, \ 'files': 1, \ 'folder_arrows': 1, \ } "If 0, do not show the icons for one of 'git' 'folder' and 'files' "1 by default, notice that if 'files' is 1, it will only display "if nvim-web-devicons is installed and on your runtimepath. "if folder is 1, you can also tell folder_arrows 1 to show small arrows next to the folder icons. "but this will not work when you set indent_markers (because of UI conflict)

" default will show icon by default if no icon is provided " default shows no icon by default let g:nvim_tree_icons = { \ 'default': '', \ 'symlink': '', \ 'git': { \ 'unstaged': "✗", \ 'staged': "✓", \ 'unmerged': "", \ 'renamed': "➜", \ 'untracked': "★", \ 'deleted': "", \ 'ignored': "◌" \ }, \ 'folder': { \ 'arrow_open': "", \ 'arrow_closed': "", \ 'default': "", \ 'open': "", \ 'empty': "", \ 'empty_open': "", \ 'symlink': "", \ 'symlink_open': "", \ }, \ 'lsp': { \ 'hint': "", \ 'info': "", \ 'warning': "", \ 'error': "", \ } \ }

nnoremap ot :NvimTreeToggle nnoremap tr :NvimTreeRefresh nnoremap tf :NvimTreeFindFile " NvimTreeOpen, NvimTreeClose and NvimTreeFocus are also available if you need them

set termguicolors " this variable must be enabled for colors to be applied properly

" a list of groups can be found at :help nvim_tree_highlight highlight NvimTreeFolderIcon guibg=blue

let g:nvim_tree_disable_default_keybindings = 1 lua <<EOF local tree_cb = require'nvim-tree.config'.nvim_tree_callback -- default mappings vim.g.nvim_tree_bindings = { { key = {"", "l", "<2-LeftMouse>"}, cb = tree_cb("edit") }, { key = {"<2-RightMouse>"}, cb = tree_cb("cd") }, { key = "", cb = tree_cb("vsplit") }, { key = "", cb = tree_cb("split") }, { key = "", cb = tree_cb("tabnew") }, { key = "<", cb = tree_cb("prev_sibling") }, { key = ">", cb = tree_cb("next_sibling") }, { key = "[", cb = tree_cb("parent_node") }, { key = "", cb = tree_cb("close_node") }, { key = "h", cb = tree_cb("close_node") }, { key = "", cb = tree_cb("preview") }, { key = "gg", cb = tree_cb("first_sibling") }, { key = "G", cb = tree_cb("last_sibling") }, { key = "I", cb = tree_cb("toggle_ignored") }, { key = "H", cb = tree_cb("toggle_dotfiles") }, { key = "R", cb = tree_cb("refresh") }, { key = "a", cb = tree_cb("create") }, { key = "d", cb = tree_cb("remove") }, { key = "r", cb = tree_cb("rename") }, { key = "", cb = tree_cb("full_rename") }, { key = "x", cb = tree_cb("cut") }, { key = "c", cb = tree_cb("copy") }, { key = "p", cb = tree_cb("paste") }, { key = "y", cb = tree_cb("copy_name") }, { key = "Y", cb = tree_cb("copy_path") }, { key = "gy", cb = tree_cb("copy_absolute_path") }, { key = "[c", cb = tree_cb("prev_git_item") }, { key = "]c", cb = tree_cb("next_git_item") }, { key = "-", cb = tree_cb("dir_up") }, { key = "e", cb = tree_cb("system_open") }, { key = "q", cb = tree_cb("close") }, { key = "?", cb = tree_cb("toggle_help") }, } EOF "}}} "{{{ Treesiter vim plugin lua <<EOF require'nvim-treesitter.configs'.setup { highlight = { enable = true, disable = {}, }, incremental_selection = { enable = true, disable = {}, }, indent = { enable = true, disable = {}, }, textobjects = { enable = false, disable = {}, }, ensure_installed = { "tsx", "r", "fish", "php", "json", "yaml", "swift", "html", "scss", "bash", "lua", "julia", "regex", "scala", "python", "vim", }, } EOF "}}} "{{{ Indent plugin lua <<EOF require("indent_blankline").setup { char = "|", buftype_exclude = {"terminal"}, space_char = " ", use_treesitter = {v = true} } EOF "}}} "{{{ LSP plugin

lua <<EOF require'lspconfig'.pyright.setup{} require'lspconfig'.r_language_server.setup{} require'lspconfig'.bashls.setup{} require'lspconfig'.julials.setup{} require'lspconfig'.diagnosticls.setup{} EOF " auto-format autocmd BufWritePre .py lua vim.lsp.buf.formatting_sync(nil, 100) autocmd BufWritePre .r lua vim.lsp.buf.formatting_sync(nil, 100) "}}} "{{{ LSPsaga plugin

lua <<EOF require'lspsaga'.init_lsp_saga() EOF

" " -- show hover doc nnoremap K lua require('lspsaga.hover').render_hover_doc() " " -- scroll down hover doc or scroll in definition preview nnoremap lua require('lspsaga.action').smart_scroll_with_saga(1) nnoremap lua require('lspsaga.action').smart_scroll_with_saga(-1)

" " -- code action nnoremap ca lua require('lspsaga.codeaction').code_action() vnoremap ca :lua require('lspsaga.codeaction').range_code_action()

" " -- lsp provider to find the cursor word definition and reference nnoremap gf lua require'lspsaga.provider'.lsp_finder()

" " -- show signature help nnoremap gh lua require('lspsaga.signaturehelp').signature_help()

" " -- rename nnoremap gr lua require('lspsaga.rename').rename()

" " -- preview definition nnoremap gd lua require'lspsaga.provider'.preview_definition()

nnoremap cd lua require'lspsaga.diagnostic'.show_line_diagnostics() " " -- only show diagnostic if cursor is over the area nnoremap cc lua require'lspsaga.diagnostic'.show_cursor_diagnostics()

" " -- jump diagnostic nnoremap [e lua require'lspsaga.diagnostic'.lsp_jump_diagnostic_prev() nnoremap ]e lua require'lspsaga.diagnostic'.lsp_jump_diagnostic_next()

" " -- float terminal also you can pass the cli command in open_float_terminal function nnoremap lua require('lspsaga.floaterm').open_float_terminal() tnoremap <C->:lua require('lspsaga.floaterm').close_float_terminal() "}}} ""{{{ Cmp completion plugins

"" Setup global configuration. More on configuration below. "lua <<EOF " local cmp = require('cmp') " cmp.setup { " snippet = { " expand = function(args) " -- You must install vim-vsnip if you use the following as-is. " vim.fn'vsnip#anonymous' " end " },

"-- You must set mapping if you want. " mapping = { " [''] = cmp.mapping.select_prev_item(), " [''] = cmp.mapping.select_next_item(), " [''] = cmp.mapping.scroll_docs(-4), " [''] = cmp.mapping.scroll_docs(4), " [''] = cmp.mapping.complete(), " [''] = cmp.mapping.close(), " [''] = cmp.mapping.confirm({ " behavior = cmp.ConfirmBehavior.Insert, " select = true, " }) " },

" -- You should specify your installed sources. " sources = { " { name = 'buffer' }, " }, " } "EOF

"" Setup buffer configuration (nvim-lua source only enables in Lua filetype). "autocmd FileType lua lua require'cmp'.setup.buffer { "\ sources = { "\ { name = 'buffer' }, "\ { name = 'nvim_lua' }, "\ }, "\ } ""}}} "{{{ nvim-compe autocomplete plugin set completeopt=menuone,noselect let g:compe = {} let g:compe.enabled = v:true let g:compe.autocomplete = v:true let g:compe.debug = v:false let g:compe.min_length = 1 let g:compe.preselect = 'enable' let g:compe.throttle_time = 80 let g:compe.source_timeout = 200 let g:compe.resolve_timeout = 800 let g:compe.incomplete_delay = 400 let g:compe.max_abbr_width = 100 let g:compe.max_kind_width = 100 let g:compe.max_menu_width = 100 let g:compe.documentation = v:true let g:compe.source = {} let g:compe.source.path = v:true let g:compe.source.buffer = v:true let g:compe.source.calc = v:true let g:compe.source.nvim_lsp = v:true let g:compe.source.nvim_lua = v:true let g:compe.source.vsnip = v:true let g:compe.source.ultisnips = v:true let g:compe.source.luasnip = v:true let g:compe.source.emoji = v:true

inoremap compe#complete() inoremap compe#confirm('') inoremap compe#close('') " inoremap compe#scroll({ 'delta': +4 }) " inoremap compe#scroll({ 'delta': -4 })

lua <<EOF local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities.textDocument.completion.completionItem.snippetSupport = true capabilities.textDocument.completion.completionItem.resolveSupport = { properties = { 'documentation', 'detail', 'additionalTextEdits', } }

require'lspconfig'.rust_analyzer.setup { capabilities = capabilities, } local t = function(str) return vim.api.nvim_replace_termcodes(str, true, true, true) end

local check_back_space = function() local col = vim.fn.col('.') - 1 return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil end

-- Use (s-)tab to: --- move to prev/next item in completion menuone --- jump to prev/next snippet's placeholder

_G.tab_complete = function() if vim.fn.pumvisible() == 1 then return t "" elseif vim.fn["UltiSnips#CanExpandSnippet"]() == 1 or vim.fn["UltiSnips#CanJumpForwards"]() == 1 then return vim.api.nvim_replace_termcodes("=UltiSnips#ExpandSnippetOrJump()", true, true, true) elseif check_back_space() then return t "" else return vim.fn['compe#complete']() end end _G.s_tab_complete = function() if vim.fn.pumvisible() == 1 then return t "" elseif vim.fn["UltiSnips#CanJumpBackwards"]() == 1 then return vim.api.nvim_replace_termcodes("=UltiSnips#JumpBackwards()", true, true, true) else -- If is not working in your terminal, change it to return t "" end end EOF "}}}

"{{{lsp-signature plugin lua <<EOF require "lsp_signature".setup() return M EOF "}}}

"{{{ Yank history plugin nnoremap yc :YankHistoryClean nnoremap yh :YankHistoryPaste nnoremap yo :YankHistoryRg ""}}} "{{{Recover swap plugin nnoremap dc :diffoff!:close "}}} "{{{ Template plugin let g:tmpl_search_paths = ['~/MEGA/resource_tientran/linux_tool/vim_template/'] "}}}

"{{{Wiki.vim plugin let g:wiki_mappings_use_defaults = 'none' let g:wiki_filetypes = ['md'] " function! WikiRoot() " let l:local = finddir( ';./') " return !empty(l:local) ? l:local : '~/MEGA/' " endfunction let g:wiki_root = '~/MEGA/' let g:wiki_journal = { \ 'name': 'journal', \ 'frequency': 'daily', \ 'date_format': { \ 'daily' : '%Y%m%d', \ 'weekly' : '%Y_w%V', \ 'monthly' : '%Y_m%m', \ }, } let g:wiki_export = { \ 'args' : '', \ 'from_format' : 'markdown', \ 'ext' : 'pdf', \ 'link_ext_replace': v:false, \ 'view' : v:false, \ 'output': '~/Downloads/abc/', } let g:wiki_tags = { \ 'output' : 'cursor', } let g:wiki_fzf_pages_opts = '--preview "cat {1}"' let g:wiki_tags_scan_num_lines = 'all' let g:wiki_link_extension = ['md'] let g:wiki_link_target_type = ['md'] let g:wiki_filetypes = ['md']

" let g:wiki_zotero_root = 'somedir' nnoremap wg (wiki-graph-in) nnoremap wG (wiki-graph-out) nnoremap wp (wiki-export) xnoremap wp (wiki-export) nnoremap tl (wiki-tag-list) nnoremap st (wiki-fzf-tags) nnoremap sc (wiki-fzf-toc) nnoremap sp (wiki-fzf-page) "}}}

Best regards, Tien

On Fri, Oct 1, 2021 at 6:10 PM Michal Hoftich @.***> wrote:

@duytientran https://github.com/duytientran I am afraid that I still cannot see it. It seems that Github removed it from your mail. Could you please try to put it somewhere else?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/michal-h21/vimwiki-sync/issues/5#issuecomment-932017262, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQAZCNAON4G7J4QP3RNC4NTUEVUI5ANCNFSM5DRSPQHA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.