Open duytientran opened 3 years ago
Hi, I've updated README with some basic instructions. I hope it helps.
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.
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.
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.
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.
@duytientran sorry for the late reply, I somehow missed your update. Can you please re-send your config file? I cannot see it.
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.
@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?
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
"{{{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
"{{{ Movement
"Bring next or previous search results to midscreen
nnoremap
"{{{Vim visual mode mapping
vnoremap . :normal.
"{{{ 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
"{{{ 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
"{{{ Abbreviation Configuration
let g:AutoPairsMapSpace=0
" Title: Abbreviation expansions
" Author: Michael Geddes
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('
" 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("\
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
"{{{ 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
"{{{ Tagbar plugin
nmap
"search current word
"nnoremap
"{{{ NNN Plugin
let g:nnn#set_default_mappings = 0 " Disable default mappings
" Start nnn in the current file's directory
" nnoremap
"{{{ 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(
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(
"{{{ 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
"{{{ Vim Markdown Plugin
" Display TOC on quickfix
nnoremap
"{{{ Ultisnips Plugin
" Trigger configuration. Do not use
"{{{ 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
""{{{ 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
"{{{ Easymotion Plugins and Accesories
let g:EasyMotion_do_mapping = 0 " Disable default mappings
map /
"{{{ 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
"{{{ Vim Easy Align Plugin
" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga
"{{{ 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
"{{{ 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
""{{{ Move up and down navigation
" inoremap
" Use
" function! s:check_back_space() abort " let col = col('.') - 1 " return !col || getline('.')[col - 1] =~# '\s' " endfunction
" let g:coc_snippet_next = '
" inoremap
" 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": {
"
"{{{ 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
"{{{ 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
"{{{ Undotree Plugin
"Mapping F5 to toggle undo tree
nnoremap
"{{{ Quickfix Configuration
command! Vlist botright vertical copen | vertical resize 50
nnoremap
"{{{ Quickfix vimqf plugin
nmap
nmap {
"{{{ Thesaurus Plugin
nnoremap
"{{{ 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
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
"{{{ 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
"{{{Plugin Management Keymaps
nnoremap
"{{{ 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
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 = {"
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
" " -- code action
nnoremap
" " -- lsp provider to find the cursor word definition and reference
nnoremap
" " -- show signature help
nnoremap
" " -- rename
nnoremap
" " -- preview definition
nnoremap
nnoremap
" " -- jump diagnostic
nnoremap
" " -- float terminal also you can pass the cli command in
open_float_terminal function
nnoremap
"" 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 = {
" ['
" -- 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
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 "
"{{{lsp-signature plugin lua <<EOF require "lsp_signature".setup() return M EOF "}}}
"{{{ Yank history plugin
nnoremap
"{{{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
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.
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