Compare commits

..

No commits in common. "5e5c5464d3b773875a02426fa1c7b31bcfad23e8" and "d6d23f913b991fc046d89b44af48d14a2277437d" have entirely different histories.

10 changed files with 122 additions and 108 deletions

View File

@ -1,4 +0,0 @@
let g:copilot_no_tab_map = v:true
imap <c-l> <plug>(copilot-next)
imap <c-h> <plug>(copilot-prev)
imap <silent><script><expr> <s-tab> copilot#Accept("\<CR>")

View File

@ -1,3 +0,0 @@
" Paste clipboard images
au FileType pandoc nmap <buffer><silent> <leader>v :call mdip#MarkdownClipboardImage()<CR>
au FileType markdown nmap <buffer><silent> <leader>v :call mdip#MarkdownClipboardImage()<CR>

View File

@ -1,3 +0,0 @@
nmap s <Nop>
xmap s <Nop>
let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes)

View File

@ -1,3 +0,0 @@
xm <leader>c <plug>Commentary
nm <leader>c <plug>Commentary
nm <leader>cc <plug>CommentaryLine

View File

@ -1,15 +0,0 @@
let g:pandoc#syntax#conceal#urls=1
let g:pandoc#syntax#codeblocks#embeds#langs=[
\ 'python',
\ 'bash',
\ 'javascript',
\ 'typescript',
\ 'html',
\ 'css',
\ 'scss',
\ 'json',
\ 'yaml'
\ ]
let g:pandoc#syntax#style#emphases=0 " Bug workaround
let g:pandoc#syntax#conceal#cchar_overrides = { "atx": " ", "li": "·" }
let g:pandoc#syntax#conceal#blacklist=[]

View File

@ -1,7 +0,0 @@
au FileType pandoc call pandoc#completion#Init()
let g:pandoc#filetypes#pandoc_markdown=0
let g:pandoc#spell#enabled=0
let g:pandoc#spell#default_langs=['en_us', 'nl_be']
let g:pandoc#formatting#mode='a'
let g:pandoc#formatting#textwidth=90
let g:pandoc#modules#disabled = ["formatting", "dashes", "yaml", "metadata"]

View File

@ -1,44 +1,5 @@
" Change local buffer to directory of current file after the plugin has loaded " " Change local buffer to directory of current file after the plugin has loaded
autocmd VimEnter * lcd %:p:h autocmd VimEnter * lcd %:p:h
" " Override wiki index mapping to also cd into the wiki " " Override wiki index mapping to also cd into the wiki
nm <leader>ww <plug>(wiki-index) nm <leader>ww <Plug>(wiki-index) \| :lcd %:p:h<cr>
" nm <leader>l <plug>(wiki-next-link)
" nm <leader>h <plug>(wiki-prev-link)
" nm <leader>j <plug>(wiki-link-follow)
" nm <leader>k <plug>(wiki-link-return)
" nm <leader>s <plug>(wiki-link-follow-split)
" nm <leader>v <plug>(wiki-link-follow-vsplit)
autocmd BufEnter *.md if expand('%:t') =~ '_' | echo 'hierarchical relation' | endif
autocmd BufEnter *.md if expand('%:t') =~ '--' | echo 'non-hierarchical relation' | endif
autocmd BufEnter *.md if expand('%:t') =~ '<>' | echo 'dichotomy' | endif
autocmd BufEnter *.md if expand('%:t') =~ 'my-' | echo 'personal file' | endif
autocmd BufEnter *.md if expand('%:t') =~ 'project-' | echo 'project file' | endif
autocmd BufEnter *.md if expand('%:t') =~ 'project_' | echo 'project file' | endif
" Only load wiki.vim for zk directory
let g:wiki_global_load=0
let g:wiki_root='~/.zk'
let g:wiki_index_name='index'
let g:wiki_zotero_root='~/doc/Zotero'
let g:wiki_filetypes=['md']
let g:wiki_completion_case_sensitive=0
" Links
let g:wiki_link_extension=''
" Do not automatically transform to link, use `<leader>wf` for this
let g:wiki_link_toggle_on_follow=0
let g:wiki_link_target_type='md'
" E.g. transform `My link` into `[My link](my-link.md)`
function Slugify(text) abort
return [substitute(tolower(a:text), '\s\+', '-', 'g'), a:text]
endfunction
let g:wiki_map_text_to_link='Slugify'
vmap <leader>wf <plug>(wiki-link-toggle-visual)
" Automatically save when navigation
let g:wiki_write_on_nav=1

View File

@ -3,18 +3,14 @@
* Linting & (Auto)formatting * Linting & (Auto)formatting
*/ */
"coc.preferences.formatOnType": true,
"coc.preferences.formatOnSave": true,
"prettier.configPath": ".prettierrc",
"prettier.ignorePath": ".prettierignore",
"prettier.semi": false, "prettier.semi": false,
"prettier.tabWidth": 2, "prettier.tabWidth": 2,
"prettier.singleQuote": true, "prettier.singleQuote": true,
"prettier.arrowParens": "avoid", "prettier.arrowParens": "avoid",
"prettier.printWidth": 120, "prettier.printWidth": 120,
"eslint.format.enable": true, "eslint.format.enable": true,
"eslint.onIgnoredFiles": "warn", "coc.preferences.formatOnType": true,
"coc.preferences.formatOnSave": true,
// Markdown // Markdown
"markdownlint.config": { "markdownlint.config": {

View File

@ -1,15 +1,11 @@
snippet shebabash "Bash shebang" i snippet shebang
#!/usr/bin/env bash #!/usr/bin/env bash
endsnippet endsnippet
snippet shebapython "Python shebang" i snippet shebangp
#!/usr/bin/env python #!/usr/bin/env python
endsnippet endsnippet
snippet shebanode "Node shebang" i snippet shebangn
#!/usr/bin/env node #!/usr/bin/env node
endsnippet endsnippet
snippet shebats "Typescript shebang" i
#!/usr/bin/env ts-node
endsnippet

134
.vimrc
View File

@ -74,6 +74,9 @@ ino <up> <nop>| " "
ino <right> <nop>| " " ino <right> <nop>| " "
" Search " Search
nn <c-_> :noh<cr>| " map 'ctrl + /' nn <c-_> :noh<cr>| " map 'ctrl + /'
" Use `the_silver_searcher` to find results (for selection if selection)
nn <leader>f :Ag <cr>
vm <leader>f y:Ag <C-r>"<cr>
" Toggle line numbers " Toggle line numbers
nn <leader>n :set nu! rnu!<cr> nn <leader>n :set nu! rnu!<cr>
" Vim configuration " Vim configuration
@ -111,8 +114,6 @@ Plug 'peitalin/vim-jsx-typescript', { 'for': ['typescript.tsx'] }
Plug 'evanleck/vim-svelte', {'branch': 'main'} Plug 'evanleck/vim-svelte', {'branch': 'main'}
" JSON with comments " JSON with comments
Plug 'neoclide/jsonc.vim' Plug 'neoclide/jsonc.vim'
" Jupyter
Plug 'quarto-dev/quarto-vim'
" LaTeX " LaTeX
Plug 'lervag/vimtex' Plug 'lervag/vimtex'
" Wiki " Wiki
@ -137,8 +138,22 @@ call plug#end()
" Plugin config {{{ " Plugin config {{{
" `.../sandwich` {{{
nmap s <Nop>
xmap s <Nop>
let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes)
" }}} " }}}
" `.../copilot` {{{
let g:copilot_node_command = "/home/h/.config/nvm/versions/node/v16.18.0/bin/node"
let g:copilot_no_tab_map = v:true
imap <c-l> <Plug>(copilot-next)
imap <c-h> <Plug>(copilot-prev)
imap <silent><script><expr> <s-tab> copilot#Accept("\<CR>")
" Show Copilot node v16 as it does not work with v18 yet
" }}}
" `.../vimtex` {{{ " `.../vimtex` {{{
@ -149,32 +164,101 @@ let g:vimtex_quickfix_mode=0
" }}} " }}}
" 'ferrine/md-img-paste.vim' {{{
" Paste clipboard images
au FileType pandoc nmap <buffer><silent> <leader>v :call mdip#MarkdownClipboardImage()<CR>
au FileType markdown nmap <buffer><silent> <leader>v :call mdip#MarkdownClipboardImage()<CR>
" }}}
" 'tpope/vim-commentary' {{{
xm <leader>c <Plug>Commentary
nm <leader>c <Plug>Commentary
nm <leader>cc <Plug>CommentaryLine
" }}}
" `junegunn/fzf` {{{ " `junegunn/fzf` {{{
" `junegunn/fzf.vim` " `junegunn/fzf.vim`
" FZF let g:fzf_layout = {'window': { 'width': 1, 'height': 0.62}}
nn <c-p> :FZF<cr> let g:fzf_colors =
nn <leader>p :FZF<cr> \ { 'fg': ['fg', 'Normal'],
nn <leader>b :Buffers<cr> \ 'bg': ['bg', 'Normal'],
nn <leader>h :History<cr> \ 'hl': ['fg', 'Comment'],
let g:fzf_action = { \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'ctrl-t': 'tab split', \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'ctrl-s': 'split', \ 'hl+': ['fg', 'Statement'],
\ 'ctrl-v': 'vsplit' \ 'info': ['fg', 'PreProc'],
\} \ 'border': ['fg', 'Comment'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
" Insert path completion let g:ag_working_path_mode="r"
" ino <expr><c-f> fzf#vim#complete#path('ag -l -g *.md')
" ino <c-f> <plug>(fzf-complete-file-ag) " }}}
ino <expr><c-f> fzf#vim#complete#path("ag -l -g '' \| sed -e 's/\.md$//'")
" Use `the_silver_searcher` to find results (for selection if selection) " `vim-pandoc/vim-pandoc` {{{
nn <leader>f :Ag<cr> " `vim-pandoc/vim-pandoc-syntax`
vm <leader>f :Ag <C-r>"<cr>
au FileType pandoc call pandoc#completion#Init()
let g:pandoc#filetypes#pandoc_markdown=0
let g:pandoc#spell#enabled=0
let g:pandoc#spell#default_langs=['en_us', 'nl_be']
let g:pandoc#formatting#mode='a'
let g:pandoc#formatting#textwidth=90
let g:pandoc#modules#disabled = ["formatting", "dashes", "yaml", "metadata"]
let g:pandoc#syntax#conceal#urls=1
let g:pandoc#syntax#conceal#blacklist=[]
let g:pandoc#syntax#style#emphases=0 " Bug workaround
let g:pandoc#syntax#conceal#cchar_overrides = { "atx": " ", "li": "·" }
" }}} " }}}
" }}}
" `lervag/wiki.vim` {{{
" Only load wiki.vim for zk directory
let g:wiki_global_load=0
let g:wiki_root='~/.zk'
let g:wiki_index_name='index'
let g:wiki_zotero_root='~/doc/Zotero'
let g:wiki_filetypes=['md']
let g:wiki_completion_case_sensitive=0
" If we are on a wiki link
" TODO: configure the following
" let g:wiki_file_handlenmap r
" Links
" FIXME: figure out what '' vs '.md' does
let g:wiki_link_extension='.md'
" Do not automatically transform to link, use `<leader>wf` for this
let g:wiki_link_toggle_on_follow=0
let g:wiki_link_target_type='md'
let g:wiki_map_text_to_link='Slugify'
" E.g. transform `My link` into `[My link](my-link.md)`
function Slugify(text) abort
return [substitute(tolower(a:text), '\s\+', '-', 'g'), a:text]
endfunction
vmap <leader>wf <Plug>(wiki-link-toggle-visual)
" Automatically save when navigation
let g:wiki_write_on_nav=1
" }}} " }}}
" `tools-life/taskwiki` {{{ " `tools-life/taskwiki` {{{
@ -222,6 +306,18 @@ au Filetype supercollider packadd scvim
" }}} " }}}
" FZF
nn <c-p> :FZF<cr>
nn <leader>p :FZF<cr>
nn <leader>b :Buffers<cr>
nn <leader>h :History<cr>
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-s': 'split',
\ 'ctrl-v': 'vsplit'
\}
" Insert path completion
ino <expr><c-f> fzf#vim#complete#path('rg --files --sort path')
" }}} " }}}