├── doc └── handy.txt ├── colors └── handy.vim ├── pack ├── color │ └── opt │ │ └── .gitkeep └── start │ └── .gitkeep ├── templates ├── template.vim ├── template.python ├── template.plaintex ├── template.sh ├── template.javascript ├── template.lua ├── template.py ├── template.json ├── template.css ├── template.xml ├── template.markdown ├── template.swift ├── template.c ├── template.tex ├── template.cpp ├── template.make ├── template.html └── template.latex ├── dict ├── vim.dict ├── sh.dict ├── gitcommit.dict └── all.dict ├── vimrc ├── gvimrc ├── .themisrc ├── after ├── ftplugin │ ├── dbout.vim │ ├── help.vim │ ├── plantuml.vim │ ├── taskpaper.vim │ ├── gitcommit.vim │ ├── json5.vim │ ├── python.vim │ ├── html.vim │ ├── javascript.vim │ ├── log.vim │ ├── snippets.vim │ ├── swift.vim │ ├── sh.vim │ ├── nerdtree.vim │ ├── zsh.vim │ ├── mysql.vim │ ├── fugitive.vim │ ├── sqlite.vim │ ├── sqlserver.vim │ ├── objc.vim │ ├── xml.vim │ ├── beancount.vim │ ├── qf.vim │ ├── yaml.vim │ ├── c.vim │ ├── cpp.vim │ ├── jsonc.vim │ ├── netrw.vim │ ├── ruby.vim │ ├── vim.vim │ ├── floaterm.vim │ ├── json.vim │ ├── sql.vim │ ├── dart.vim │ └── rst.vim └── syntax │ ├── python.vim │ └── html.vim ├── crystal.aiff ├── img ├── fern.png ├── fzf.png ├── start.png ├── asynctasks.png ├── floaterm.png └── markdown.png ├── bin ├── mvim_hide_floaterm ├── mvim_edit_file ├── vman └── vmore ├── ftdetect ├── applescript.vim ├── term.vim ├── log.vim ├── objc.vim ├── bash.vim ├── sqlite.vim ├── sqlserver.vim ├── markdown.vim ├── brewfile.vim ├── ruby.vim └── jsonc.vim ├── autoload ├── hl │ ├── fern.vim │ ├── gruvbox.vim │ ├── json.vim │ ├── snippets.vim │ ├── git.vim │ ├── sql.vim │ ├── netrw.vim │ ├── asynctasks.vim │ ├── coc.vim │ ├── buffer.vim │ ├── get.vim │ ├── fzf.vim │ ├── format.vim │ ├── chezmoi.vim │ ├── fs.vim │ ├── onedark.vim │ ├── objc.vim │ ├── markdown.vim │ └── util.vim ├── vim_snippets.vim ├── gruvbox.vim ├── floaterm │ └── wrapper │ │ └── hl_yazi.vim ├── onedark.vim ├── lightline │ └── colorscheme │ │ ├── gruvbox.vim │ │ └── onedark.vim └── airline │ └── themes │ └── gruvbox.vim ├── main ├── neovimrc ├── preinit.vim └── path.vim ├── indent └── cpp.vim ├── syntax ├── marker.vim └── brewfile.vim ├── plugin ├── vista.vim ├── vim-fugitive.vim ├── fern-mapping-fzf.vim ├── vim-move.vim ├── comment.vim ├── vim-cycle.vim ├── python-syntax.vim ├── taskpaper.vim ├── vim-maximizer.vim ├── traces.vim ├── vim-signature.vim ├── hlyank.vim ├── echodoc.vim ├── verdin.vim ├── copilot.vim ├── cocoapods.vim ├── vim-rst.vim ├── fern-renderer-nerdfont.vim ├── wilder.vim ├── vim-orgmode.vim ├── polyglot.vim ├── xkbswitch.vim ├── eregex.vim ├── simpyfold.vim ├── oscyank.vim ├── vim-surround.vim ├── vimspector.vim ├── leetcode.vim ├── vim-gpt-commit.vim ├── vim-alternate.vim ├── easymotion.vim ├── abbreviate.vim ├── matchup.vim ├── projectionist.vim ├── localvimrc.vim ├── beancount.vim ├── complete-parameter.vim ├── dirvish.vim ├── ultisnip.vim ├── editorconfig-vim.vim ├── rooter.vim ├── limelight.vim ├── vim-togglecursor.vim ├── vim-qf.vim ├── emmet-vim.vim ├── fastfold.vim ├── fern-git-status.vim ├── markdown-preview.vim ├── diff.vim ├── vim-auto-popmenu.vim ├── cosco.vim ├── vimwiki.vim ├── nerdtree.vim ├── vim-sneak.vim ├── tagbar.vim ├── bracey.vim ├── vim-dict.vim ├── synstatics.vim ├── vim-flutter.vim ├── vim-floaterm.vim ├── asynctasks.vim ├── indent-guides.vim ├── netrw.vim ├── autopairs.vim ├── indentline.vim ├── nerdcommenter.vim ├── inline_edit.vim ├── terminal_help.vim ├── hiPairs.vim ├── vim-barbaric.vim ├── vim-cpp-enhanced-highlight.vim ├── signify.vim ├── leaderf.vim ├── colorizer.vim ├── vim-test.vim ├── asyncrun.vim ├── tablemode.vim ├── rainbow.vim ├── vim-sandwich.vim ├── conflict-marker.vim ├── nerdtree-git-plugin.vim ├── vim-dadbod-ui.vim ├── fern.vim ├── vim-markdown.vim ├── vim-devicons.vim ├── gitgutter.vim ├── coc.vim ├── ale.vim ├── fzf.vim ├── startify.vim ├── ycm.vim ├── autoformat.vim ├── quickui.vim ├── gutentags.vim ├── lightline.vim └── vim-dotoo.vim ├── PREVIEW.md ├── .gitignore ├── test └── test_hl.vim ├── pythonx ├── javascript_snippets.py └── vimsnippets.py ├── LICENSE ├── .vmorerc ├── README.md ├── init.vim ├── .gitmodules ├── unused └── run.vim ├── ginit.vim └── tasks.ini /doc/handy.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /colors/handy.vim: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pack/color/opt/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pack/start/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/template.vim: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dict/vim.dict: -------------------------------------------------------------------------------- 1 | dict_vim 2 | -------------------------------------------------------------------------------- /templates/template.python: -------------------------------------------------------------------------------- 1 | template.py -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | source $HOME/.vim/init.vim 2 | -------------------------------------------------------------------------------- /dict/sh.dict: -------------------------------------------------------------------------------- 1 | globbing 2 | shellcheck 3 | -------------------------------------------------------------------------------- /templates/template.plaintex: -------------------------------------------------------------------------------- 1 | template.tex -------------------------------------------------------------------------------- /templates/template.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | -------------------------------------------------------------------------------- /gvimrc: -------------------------------------------------------------------------------- 1 | source /Users/hanley/.vim/ginit.vim 2 | -------------------------------------------------------------------------------- /templates/template.javascript: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | -------------------------------------------------------------------------------- /templates/template.lua: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env lua 2 | 3 | -------------------------------------------------------------------------------- /.themisrc: -------------------------------------------------------------------------------- 1 | let g:assert = themis#helper('assert') 2 | 3 | -------------------------------------------------------------------------------- /after/ftplugin/dbout.vim: -------------------------------------------------------------------------------- 1 | setlocal bufhidden=delete 2 | -------------------------------------------------------------------------------- /templates/template.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | 4 | -------------------------------------------------------------------------------- /templates/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "key1": "value" 3 | } 4 | -------------------------------------------------------------------------------- /templates/template.css: -------------------------------------------------------------------------------- 1 | 2 | /* vim:se fdm=marker fmr={,}: */ 3 | -------------------------------------------------------------------------------- /templates/template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /crystal.aiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanleylee/dotvim/HEAD/crystal.aiff -------------------------------------------------------------------------------- /img/fern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanleylee/dotvim/HEAD/img/fern.png -------------------------------------------------------------------------------- /img/fzf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanleylee/dotvim/HEAD/img/fzf.png -------------------------------------------------------------------------------- /img/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanleylee/dotvim/HEAD/img/start.png -------------------------------------------------------------------------------- /img/asynctasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanleylee/dotvim/HEAD/img/asynctasks.png -------------------------------------------------------------------------------- /img/floaterm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanleylee/dotvim/HEAD/img/floaterm.png -------------------------------------------------------------------------------- /img/markdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanleylee/dotvim/HEAD/img/markdown.png -------------------------------------------------------------------------------- /templates/template.markdown: -------------------------------------------------------------------------------- 1 | # Template 2 | 3 | ## Header 1 4 | 5 | ## Header 2 6 | -------------------------------------------------------------------------------- /templates/template.swift: -------------------------------------------------------------------------------- 1 | func main() { 2 | print("Hello world!") 3 | } 4 | 5 | main() 6 | -------------------------------------------------------------------------------- /bin/mvim_hide_floaterm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | mvim --remote-expr "hl#buffer#HideFloaterm()" 4 | -------------------------------------------------------------------------------- /templates/template.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv){ 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /templates/template.tex: -------------------------------------------------------------------------------- 1 | \usemodule[zhfonts] 2 | \zhfonts[rm, 11pt] 3 | 4 | \starttext 5 | 6 | 7 | \stoptext 8 | -------------------------------------------------------------------------------- /templates/template.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | int main(int argc, char** argv){ 6 | } 7 | -------------------------------------------------------------------------------- /templates/template.make: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS=-g -Wall 3 | LDFLAGS= 4 | 5 | .PHONY: all clean 6 | 7 | clean: 8 | -rm *.o 9 | -------------------------------------------------------------------------------- /ftdetect/applescript.vim: -------------------------------------------------------------------------------- 1 | augroup AppleScriptDetect 2 | au! 3 | au BufNewFile,BufRead */.local/bin/osascript/* setf applescript 4 | augroup END 5 | -------------------------------------------------------------------------------- /autoload/hl/fern.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | -------------------------------------------------------------------------------- /dict/gitcommit.dict: -------------------------------------------------------------------------------- 1 | update 2 | add 3 | feature 4 | fix 5 | style 6 | opt 7 | doc 8 | test 9 | revert 10 | build 11 | adapt 12 | chore 13 | 14 | Podfile 15 | -------------------------------------------------------------------------------- /after/ftplugin/help.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | 7 | -------------------------------------------------------------------------------- /after/ftplugin/plantuml.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | -------------------------------------------------------------------------------- /after/ftplugin/taskpaper.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | -------------------------------------------------------------------------------- /main/neovimrc: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | echom neovimrc 7 | -------------------------------------------------------------------------------- /indent/cpp.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal cinoptions=g-1 7 | -------------------------------------------------------------------------------- /after/ftplugin/gitcommit.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal colorcolumn= 7 | -------------------------------------------------------------------------------- /after/ftplugin/json5.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | runtime! ftplugin/json.vim 7 | -------------------------------------------------------------------------------- /after/ftplugin/python.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal foldmethod=indent 7 | -------------------------------------------------------------------------------- /after/ftplugin/html.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal foldmethod=indent 7 | 8 | -------------------------------------------------------------------------------- /syntax/marker.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " only effective for specific filetype 7 | -------------------------------------------------------------------------------- /templates/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /after/ftplugin/javascript.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal shiftwidth=2 7 | 8 | 9 | -------------------------------------------------------------------------------- /after/ftplugin/log.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal nowrap 7 | set colorcolumn=0 8 | -------------------------------------------------------------------------------- /after/ftplugin/snippets.vim: -------------------------------------------------------------------------------- 1 | setlocal expandtab 2 | 3 | vmap hl :call hl#snippets#make_hl(visualmode()) 4 | nmap hl :set operatorfunc=hl#snippets#make_hlg@ 5 | -------------------------------------------------------------------------------- /autoload/hl/gruvbox.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | function! hl#gruvbox#patch() 7 | 8 | endfunction 9 | -------------------------------------------------------------------------------- /after/ftplugin/swift.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal shiftwidth=4 7 | setlocal commentstring=//\ %s 8 | -------------------------------------------------------------------------------- /plugin/vista.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vista') 7 | finish 8 | endif 9 | 10 | -------------------------------------------------------------------------------- /after/ftplugin/sh.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " let b:matchup_matchparen_hi_surround_always = 1 7 | set foldmethod=marker 8 | -------------------------------------------------------------------------------- /after/ftplugin/nerdtree.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | nmap - u 7 | nnoremap :NERDTreeClose 8 | -------------------------------------------------------------------------------- /after/ftplugin/zsh.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " let b:matchup_matchparen_hi_surround_always = 1 7 | set foldmethod=marker 8 | -------------------------------------------------------------------------------- /plugin/vim-fugitive.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-fugitive') 7 | finish 8 | endif 9 | 10 | -------------------------------------------------------------------------------- /bin/mvim_edit_file: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | open_type="$1" 4 | file="$2" 5 | # echo "hl#buffer#openFile('$open_type', '$file')" 6 | # mvim --remote-expr "hl#buffer#HideFloaterm()" 7 | mvim --remote-expr "hl#buffer#openFile('$open_type', '$file')" 8 | -------------------------------------------------------------------------------- /plugin/fern-mapping-fzf.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('fern-mapping-fzf.vim') 7 | finish 8 | endif 9 | 10 | -------------------------------------------------------------------------------- /plugin/vim-move.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-move') 7 | finish 8 | endif 9 | let g:move_map_keys = 0 10 | -------------------------------------------------------------------------------- /ftdetect/term.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " augroup TermDetect 7 | " au! 8 | " au TermOpen term://* setf term 9 | " augroup END 10 | -------------------------------------------------------------------------------- /after/ftplugin/mysql.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " if exists("b:did_ftplugin") 7 | " finish 8 | " endif 9 | 10 | runtime! ftplugin/sql.vim 11 | -------------------------------------------------------------------------------- /ftdetect/log.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | augroup LogDetect 7 | au! 8 | au BufNewFile,BufRead *.log* setfiletype log 9 | augroup END 10 | -------------------------------------------------------------------------------- /ftdetect/objc.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " augroup ObjcDetect 7 | " au! 8 | " au BufNewFile,BufRead *.m setf objc 9 | " augroup END 10 | -------------------------------------------------------------------------------- /plugin/comment.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('comment') 7 | finish 8 | endif 9 | 10 | let g:comment_mappings = v:false 11 | -------------------------------------------------------------------------------- /plugin/vim-cycle.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-cycle') 7 | finish 8 | endif 9 | 10 | let g:cycle_no_mappings = 2 11 | -------------------------------------------------------------------------------- /after/ftplugin/fugitive.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal norelativenumber 7 | setlocal colorcolumn= 8 | 9 | nmap - 10 | -------------------------------------------------------------------------------- /after/ftplugin/sqlite.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " if exists("b:did_ftplugin") 7 | " finish 8 | " endif 9 | 10 | runtime! ftplugin/sql.vim 11 | -------------------------------------------------------------------------------- /after/ftplugin/sqlserver.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " if exists("b:did_ftplugin") 7 | " finish 8 | " endif 9 | 10 | runtime! ftplugin/sql.vim 11 | -------------------------------------------------------------------------------- /ftdetect/bash.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | augroup BashDetect 7 | au! 8 | au BufNewFile,BufRead *.bash set filetype=bash 9 | augroup END 10 | 11 | -------------------------------------------------------------------------------- /ftdetect/sqlite.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | augroup SQLDetect 7 | au! 8 | au BufNewFile,BufRead *.sqlite setfiletype sqlite 9 | augroup END 10 | -------------------------------------------------------------------------------- /plugin/python-syntax.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('python-syntax') 7 | finish 8 | endif 9 | 10 | let g:python_highlight_all = 1 11 | -------------------------------------------------------------------------------- /plugin/taskpaper.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-taskpaper') 7 | finish 8 | endif 9 | 10 | let g:task_paper_no_maps = 0 11 | 12 | -------------------------------------------------------------------------------- /autoload/hl/json.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | function! hl#json#RemoveComment() range 7 | execute a:firstline . "," . a:lastline . " s#\s*//.*##" 8 | endfunction 9 | -------------------------------------------------------------------------------- /ftdetect/sqlserver.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | augroup SQLDetect 7 | au! 8 | au BufNewFile,BufRead *.sqlserver setfiletype sqlserver 9 | augroup END 10 | -------------------------------------------------------------------------------- /plugin/vim-maximizer.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-maximizer') 7 | finish 8 | endif 9 | let g:maximizer_set_default_mapping = 0 10 | -------------------------------------------------------------------------------- /ftdetect/markdown.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " augroup MarkdownDetect 7 | " au! 8 | " au BufNewFile,BufRead */.cheat/* setf markdown 9 | " augroup END 10 | -------------------------------------------------------------------------------- /plugin/traces.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('traces') 7 | finish 8 | endif 9 | let g:traces_timeout = 300 10 | let g:traces_search_timeout = 100 11 | -------------------------------------------------------------------------------- /plugin/vim-signature.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-signature') 7 | finish 8 | endif 9 | 10 | let g:showmarks_ignore_type = ['nerdtree'] 11 | -------------------------------------------------------------------------------- /plugin/hlyank.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('hlyank') 7 | finish 8 | endif 9 | 10 | let g:hlyank_duration = 2000 11 | let g:hlyank_invisual = v:true 12 | -------------------------------------------------------------------------------- /ftdetect/brewfile.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | augroup BrewfileDetect 7 | au! 8 | au BufNewFile,BufRead Brewfile,.Brewfile set filetype=ruby syntax=brewfile 9 | augroup END 10 | -------------------------------------------------------------------------------- /plugin/echodoc.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('echodoc.vim') 7 | finish 8 | endif 9 | 10 | let g:echodoc_enable_at_startup = 1 11 | let g:echodoc#type = 'echo' 12 | -------------------------------------------------------------------------------- /plugin/verdin.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-Verdin') 7 | finish 8 | endif 9 | 10 | let g:Verdin#autocomplete = 0 11 | let g:Verdin#cooperativemode = 1 12 | -------------------------------------------------------------------------------- /after/ftplugin/objc.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal commentstring=//\ %s 7 | setlocal formatoptions=tcl 8 | ino "\u\=hl#objc#map_match_bracket()\" 9 | -------------------------------------------------------------------------------- /ftdetect/ruby.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | augroup RubyDetect 7 | au! 8 | au BufNewFile,BufRead Fastfile setf ruby 9 | au BufNewFile,BufRead Appfile setf ruby 10 | augroup END 11 | -------------------------------------------------------------------------------- /after/ftplugin/xml.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | let g:xml_syntax_folding=1 7 | " setlocal foldmethod=syntax 8 | setlocal foldmethod=indent 9 | setlocal foldlevelstart=999 10 | setlocal foldminlines=0 11 | -------------------------------------------------------------------------------- /plugin/copilot.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('copilot.vim') 7 | finish 8 | endif 9 | 10 | 11 | " imap , copilot#Accept("\") 12 | " let g:copilot_no_tab_map = v:true 13 | -------------------------------------------------------------------------------- /plugin/cocoapods.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-cocoapods') 7 | finish 8 | endif 9 | 10 | let g:PodsConfigFile = expand('$HL_SECRET/bnc/pods.json') 11 | let g:CocoaPodsDefaultMap = 1 12 | -------------------------------------------------------------------------------- /autoload/hl/snippets.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " make snippets surrounded by 'hl_' 7 | function! hl#snippets#make_hl(mode) 8 | call hl#operate#embedded_with_string_2(a:mode, 'hl_', '_hl') 9 | endfunction 10 | 11 | -------------------------------------------------------------------------------- /plugin/vim-rst.vim: -------------------------------------------------------------------------------- 1 | let g:rst_syntax_code_list = { 2 | \ 'vim': ['vim'], 3 | \ 'sql': ['sql'], 4 | \ 'cpp': ['cpp', 'c++'], 5 | \ 'python': ['python'], 6 | \ 'json': ['json'], 7 | \ 'javascript': ['js'], 8 | \ 'sh': ['sh'], 9 | \ } 10 | 11 | -------------------------------------------------------------------------------- /plugin/fern-renderer-nerdfont.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('fern-renderer-nerdfont.vim') 7 | finish 8 | endif 9 | let g:fern#renderer#nerdfont#padding = ' ' 10 | let g:fern#renderer = 'nerdfont' 11 | -------------------------------------------------------------------------------- /after/ftplugin/beancount.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | inoremap . .:AlignCommodity 7 | 8 | " nnoremap = :AlignCommodity 9 | " vnoremap = :AlignCommodity 10 | -------------------------------------------------------------------------------- /plugin/wilder.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('wilder.nvim') 7 | finish 8 | endif 9 | 10 | call wilder#enable_cmdline_enter() 11 | set wildcharm= 12 | call wilder#set_option('modes', ['/', '?', ':']) 13 | -------------------------------------------------------------------------------- /after/ftplugin/qf.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " setlocal nonumber 7 | setlocal norelativenumber 8 | setlocal colorcolumn= 9 | 10 | " nnoremap t T 11 | nnoremap r :cdo s///gc 12 | -------------------------------------------------------------------------------- /after/ftplugin/yaml.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab 7 | 8 | " Turn off syntax highlighting for large YAML files. 9 | if line('$') > 1000 10 | setlocal syntax=OFF 11 | endif 12 | -------------------------------------------------------------------------------- /plugin/vim-orgmode.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-orgmode') 7 | finish 8 | endif 9 | 10 | let g:org_agenda_files = ['/Users/hanley/Library/Mobile Documents/com~apple~CloudDocs/iCloud_HL/todo/agenda/*.org'] 11 | -------------------------------------------------------------------------------- /plugin/polyglot.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-polyglot') 7 | finish 8 | endif 9 | 10 | " let g:polyglot_disabled = ['markdown.plugin', 'shiftwidth', 'markdown.plugin', 'sensible', 'ftdetect', 'autoindent'] 11 | -------------------------------------------------------------------------------- /plugin/xkbswitch.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('xkbswitch') 7 | finish 8 | endif 9 | 10 | let g:XkbSwitchEnabled = 1 11 | "let g:XkbSwitchIMappings = ['cn'] 12 | "let g:XkbSwitchIMappingsTr = {'cn': {'<': '', '>': ''}} 13 | 14 | -------------------------------------------------------------------------------- /after/ftplugin/c.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal foldmethod=syntax 7 | setlocal commentstring=//\ %s 8 | " let b:matchup_matchparen_hi_surround_always = 1 " 启用持续高亮 9 | let g:ycm_global_ycm_extra_conf = '~/.config/ycm/c.ycm_extra_conf.py' " 默认配置文件路径 10 | -------------------------------------------------------------------------------- /after/ftplugin/cpp.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal foldmethod=syntax 7 | setlocal commentstring=//\ %s 8 | let g:ycm_global_ycm_extra_conf = '~/.config/ycm/cpp.ycm_extra_conf.py' " 默认配置文件路径 9 | " execute 'setlocal dict+=~/.vim/words/' . &filetype. '.dict' 10 | -------------------------------------------------------------------------------- /plugin/eregex.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('eregex.vim') 7 | finish 8 | endif 9 | 10 | let g:eregex_default_enable = 0 11 | 12 | let g:eregex_forward_delim = '/' 13 | let g:eregex_backward_delim = '?' 14 | 15 | let g:eregex_force_case = 0 16 | -------------------------------------------------------------------------------- /plugin/simpyfold.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('SimpylFold') 7 | finish 8 | endif 9 | 10 | let g:SimpylFold_docstring_preview = 1 11 | let g:SimpylFold_fold_docstring = 1 12 | let g:SimpylFold_fold_import = 1 13 | let g:SimpylFold_fold_blank = 0 14 | -------------------------------------------------------------------------------- /autoload/hl/git.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | function! hl#git#branch() 7 | let l:res = systemlist('git rev-parse --abbrev-ref HEAD')[0] 8 | if match(l:res, 'fatal') != -1 9 | return '' 10 | else 11 | return l:res 12 | endif 13 | endfunction 14 | 15 | -------------------------------------------------------------------------------- /plugin/oscyank.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-oscyank') 7 | finish 8 | endif 9 | 10 | let g:oscyank_max_length = 1000000 11 | let g:oscyank_term = 'default' " or 'screen', 'kitty', 'default' 12 | let g:oscyank_silent = v:true " or 1 for older versions of Vim 13 | -------------------------------------------------------------------------------- /plugin/vim-surround.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-surround') 7 | finish 8 | endif 9 | 10 | " let g:surround_{char2nr('q')} = "**\r**" 11 | let g:surround_{char2nr('m')} = "\1Surround: \1\r\1\1" 12 | let g:surround_{char2nr('M')} = "\1S-Open: \1\r\2S-Close: \2" 13 | -------------------------------------------------------------------------------- /plugin/vimspector.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " Configuration file located at ~/.vimspector.json 7 | 8 | if !hl#plug_loaded('vimspector') 9 | finish 10 | endif 11 | 12 | " let g:vimspector_base_dir=expand('$XDG_CONFIG_HOME/vimspector') 13 | " let g:vimspector_enable_mappings = 'HUMAN' 14 | -------------------------------------------------------------------------------- /PREVIEW.md: -------------------------------------------------------------------------------- 1 | # Preview 2 | 3 | ## start 4 | 5 | ![start](./img/start.png) 6 | 7 | ## vim-markdown 8 | 9 | ![vim-markdown](./img/markdown.png) 10 | 11 | ## fzf.vim 12 | 13 | ![fzf.vim](./img/fzf.png) 14 | 15 | ## fern.vim 16 | 17 | ![fern.vim](./img/fern.png) 18 | 19 | ## vim-floaterm 20 | 21 | ![vim-floaterm](./img/floaterm.png) 22 | 23 | ## asynctasks.vim 24 | 25 | ![asynctasks.vim](./img/asynctasks.png) 26 | -------------------------------------------------------------------------------- /plugin/leetcode.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('leetcode.vim') 7 | finish 8 | endif 9 | 10 | let g:leetcode_browser = 'chrome' 11 | let g:leetcode_china = 1 12 | let g:leetcode_solution_filetype = 'cpp' 13 | let g:leetcode_hide_paid_only = '1' 14 | let g:leetcode_hide_topics = 0 15 | -------------------------------------------------------------------------------- /plugin/vim-gpt-commit.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-gpt-commit') 7 | finish 8 | endif 9 | 10 | let g:gpt_commit_key = hl#get#secret_config()['OPENAI_PROXY_CLOSEAI'] 11 | " uncomment this line below to enable proxy 12 | " let g:gpt_commit_proxy = 'https://api.openai-proxy.org' 13 | -------------------------------------------------------------------------------- /bin/vman: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | emulate -LR zsh 4 | set -e 5 | # set -x 6 | 7 | # ref: https://github.com/jez/vim-superman 8 | 9 | if [ $# -eq 0 ]; then 10 | echo "What manual page do you want?" 11 | exit 0 12 | elif ! man -w "$@" >/dev/null; then 13 | # Check that manpage exists to prevent visual noise. 14 | exit 1 15 | else 16 | ${EDITOR:-vim} -c "let g:is_vman_from_term = v:true | Superman $*" 17 | fi 18 | 19 | -------------------------------------------------------------------------------- /plugin/vim-alternate.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-alternate') 7 | finish 8 | endif 9 | 10 | let g:extraAlternativeExtensionsDic = { 11 | \ 'm': 'h' 12 | \ } 13 | let g:overrideAlternativeExtensionsDic = { 14 | \ 'h': 'm,c,cpp,cxx,cc,CC' 15 | \ } 16 | -------------------------------------------------------------------------------- /after/ftplugin/jsonc.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " setlocal commentstring=//\ %s 7 | " setlocal foldmethod=syntax 8 | 9 | runtime! ftplugin/json.vim 10 | let b:autoformat_autoindent = 1 11 | let b:autoformat_retab = 1 12 | let b:autoformat_remove_trailing_spaces = 1 13 | 14 | " gg=G 15 | " :retab 16 | " :RemoveTrailingSpaces 17 | -------------------------------------------------------------------------------- /plugin/easymotion.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-easymotion') 7 | finish 8 | endif 9 | 10 | " turn on case insensitive feature 11 | let g:EasyMotion_smartcase = 1 12 | " keep cursor column when JK motion 13 | let g:EasyMotion_startofline = 0 14 | 15 | " let g:EasyMotion_keys = 'abcdefghijkImnoparstuvwy' 16 | -------------------------------------------------------------------------------- /plugin/abbreviate.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | iabbrev improt import 7 | iabbrev imprt import 8 | iabbrev udpate update 9 | iabbrev udpates updates 10 | iabbrev udpated updated 11 | iabbrev isntall install 12 | iabbrev cofnig config 13 | iabbrev toekn token 14 | iabbrev serach search 15 | iabbrev adn and 16 | iabbrev heigth height 17 | iabbrev k8s Kubernetes 18 | -------------------------------------------------------------------------------- /plugin/matchup.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-matchup') 7 | finish 8 | endif 9 | 10 | let g:matchup_matchparen_deferred = 1 11 | let g:matchup_matchparen_hi_surround_always = 0 12 | let g:matchup_matchparen_deferred_show_delay = 200 13 | let g:matchup_matchparen_deferred_hide_delay = 1000 14 | let g:matchup_surround_enabled = 1 15 | 16 | -------------------------------------------------------------------------------- /plugin/projectionist.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('projectionist.vim') 7 | finish 8 | endif 9 | 10 | " let g:projectionist_heuristics = { 11 | " \ 'src/main/java/*.java': {'alternate': 'src/test/java/{}.java'}, 12 | " \ 'src/test/java/*.java': {'alternate': 'src/main/java/{}.java'} 13 | " \ } 14 | -------------------------------------------------------------------------------- /syntax/brewfile.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if exists('b:current_syntax') 7 | finish 8 | endif 9 | 10 | " Load ruby syntax 11 | source $VIMRUNTIME/syntax/ruby.vim 12 | unlet b:current_syntax 13 | 14 | syn keyword brewfileDirective brew cask tap mas cask_args 15 | 16 | hi def link brewfileDirective Keyword 17 | 18 | let b:current_syntax = 'brewfile' 19 | -------------------------------------------------------------------------------- /plugin/localvimrc.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-localvimrc') 7 | finish 8 | endif 9 | 10 | let g:localvimrc_name=['.lvimrc'] 11 | let g:localvimrc_enable=1 12 | let g:localvimrc_ask=1 13 | let g:localvimrc_persistent=2 14 | let g:localvimrc_count=1 "最多加载多少个 localvimrc 文件 15 | let g:localvimrc_reverse=1 "从当前文件依次向根目录查找并加载配置 localvimrc 文件 16 | -------------------------------------------------------------------------------- /plugin/beancount.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-beancount') 7 | finish 8 | endif 9 | 10 | let b:beancount_root = '$HOME/data/00_repo/18_accounting/main.bean' 11 | let g:beancount_separator_col = 50 12 | " let g:beancount_account_completion = 'default' 13 | let g:beancount_account_completion = 'default' 14 | let g:beancount_detailed_first = 1 15 | -------------------------------------------------------------------------------- /plugin/complete-parameter.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('CompleteParameter.vim') 7 | finish 8 | endif 9 | 10 | let g:complete_parameter_log_level = 5 11 | let g:complete_parameter_use_ultisnips_mapping = 0 12 | let g:complete_parameter_echo_signature = 1 13 | let g:complete_parameter_py_keep_value = 1 14 | let g:complete_parameter_py_remove_default = 1 15 | -------------------------------------------------------------------------------- /plugin/dirvish.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-dirvish') 7 | finish 8 | endif 9 | " let g:loaded_netrwPlugin = 1 10 | " command! -nargs=? -complete=dir Explore Dirvish 11 | " command! -nargs=? -complete=dir Sexplore belowright split | silent Dirvish 12 | " command! -nargs=? -complete=dir Vexplore leftabove vsplit | silent Dirvish 13 | -------------------------------------------------------------------------------- /plugin/ultisnip.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('ultisnips') 7 | finish 8 | endif 9 | 10 | let g:UltiSnipsExpandTrigger='' 11 | let g:UltiSnipsJumpForwardTrigger='' "触发下一个占位符 12 | let g:UltiSnipsJumpBackwardTrigger='' "触发上一个占位符 13 | let g:UltiSnipsListSnippets='' 14 | let g:UltiSnipsSnippetDirectories=['$HL_SNIPPETS/vim'] "定义存放代码片段的文件夹 15 | 16 | -------------------------------------------------------------------------------- /plugin/editorconfig-vim.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('editorconfig-vim') 7 | finish 8 | endif 9 | 10 | let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] 11 | 12 | " Disable for a specific filetype 13 | " au FileType gitcommit let b:EditorConfig_disable = 1 14 | 15 | " Disable rules 16 | " let g:EditorConfig_disable_rules = ['trim_trailing_whitespace'] 17 | -------------------------------------------------------------------------------- /plugin/rooter.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-rooter') 7 | finish 8 | endif 9 | 10 | let g:rooter_targets = '/,*' 11 | let g:rooter_patterns = g:hl_rootmarkers 12 | let g:rooter_change_directory_for_non_project_files = 'current' "change to the directory of current file 13 | let g:rooter_manual_only = 0 14 | let g:rooter_cd_cmd = 'lcd' 15 | let g:rooter_silent_chdir = 1 16 | -------------------------------------------------------------------------------- /after/ftplugin/netrw.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal colorcolumn= 7 | " setlocal autochdir 8 | 9 | " Show the list of marked files 10 | nmap fl :echo join(netrw#Expose("netrwmarkfilelist"), "\n") 11 | " Show the current target directory 12 | nmap ft :echo 'Target:' . netrw#Expose("netrwmftgt") 13 | " Delete a file 14 | nmap fd :call hl#netrw#remove_recursive() 15 | -------------------------------------------------------------------------------- /after/syntax/python.vim: -------------------------------------------------------------------------------- 1 | unlet b:current_syntax 2 | 3 | syn include @SQL syntax/sql.vim 4 | syntax region sqlPythonString 5 | \ matchgroup=SpecialComment 6 | \ start=~\z('''\|"""\)\_s*\(ALTER\|BEGIN\|CALL\|COMMENT\|COMMIT\|CONNECT\|CREATE\|DELETE\|DROP\|END\|EXPLAIN\|EXPORT\|GRANT\|IMPORT\|INSERT\|LOAD\|LOCK\|MERGE\|REFRESH\|RENAME\|REPLACE\|REVOKE\|ROLLBACK\|SELECT\|SET\|TRUNCATE\|UNLOAD\|UNSET\|UPDATE\|UPSERT\|WITH\)~ 7 | \ end=+\z1+ 8 | \ contains=@SQL 9 | 10 | let b:current_syntax = 'python' 11 | -------------------------------------------------------------------------------- /plugin/limelight.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('limelight.vim') 7 | finish 8 | endif 9 | 10 | "let g:limelight_default_coefficient = 0.5 "设置隐藏区域的黑暗度, 值越大越暗 11 | "let g:limelight_paragraph_span = 2 "设置暗光的跨度, 暗光所能照亮的范围 12 | "let g:limelight_priority = -1 "暗光优先级, 防止搜索的高亮效果被覆盖 13 | "autocmd! User GoyoEnter Limelight "进入 Goyo 专注插件时, 同时开启暗光效果 14 | "autocmd! User GoyoLeave Limelight! "离开 Goyo 专注插件时, 同时退出暗光效果 15 | -------------------------------------------------------------------------------- /plugin/vim-togglecursor.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-togglecursor') 7 | finish 8 | endif 9 | 10 | if exists('$TMUX') 11 | let g:togglecursor_force = 'xterm' 12 | endif 13 | " let g:togglecursor_enable_tmux_escaping = 1 14 | let g:use_togglecursor_instead_of_native_in_cli = 1 15 | let g:togglecursor_replace = 'underline' 16 | let g:togglecursor_insert = 'line' 17 | let g:togglecursor_default = 'block' 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /*backup 2 | # Swap 3 | [._]*.s[a-v][a-z] 4 | !*.svg # comment out if you don't need vector files 5 | [._]*.sw[a-p] 6 | [._]s[a-rt-v][a-z] 7 | [._]ss[a-gi-z] 8 | [._]sw[a-p] 9 | 10 | # tmp 11 | [._]*.tmp 12 | 13 | # Session 14 | Session.vim 15 | Sessionx.vim 16 | 17 | # Temporary 18 | .netrwhist 19 | *~ 20 | # Auto-generated tag files 21 | tags 22 | # Persistent undo 23 | [._]*.un~ 24 | .DS_Store 25 | # vim-plug 26 | /plugged/ 27 | # viewdir 28 | /view/ 29 | 30 | .viminfo 31 | .nviminfo 32 | 33 | __pycache__ 34 | /sessions/ 35 | venv/ 36 | -------------------------------------------------------------------------------- /templates/template.latex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper,11pt,titlepage]{article} 2 | % \usepackage[margin=4cm]{geometry} 3 | % \usepackage{CJK} 4 | \usepackage{CJKutf8} 5 | % 这个在 hyperref 包中可以用中文标题了 6 | \usepackage[unicode,pdfborder={0 0 0}]{hyperref} 7 | % unicode 让标题支持 Unicode 8 | \begin{document} 9 | \begin{CJK}{UTF8}{gbsn} 10 | 11 | \title{} 12 | \author{} 13 | \date{\today} 14 | \maketitle 15 | 16 | \tableofcontents 17 | % 这里不能有中文 18 | \clearpage 19 | 20 | \section{} 21 | 22 | 23 | \end{CJK} 24 | \end{document} 25 | 26 | % vim:tw=78:fo-=c:isk+=-,' 27 | -------------------------------------------------------------------------------- /plugin/vim-qf.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-qf') 7 | finish 8 | endif 9 | 10 | " let g:qf_mapping_ack_style = 0 11 | let g:qf_window_bottom = 1 12 | let g:qf_auto_open_quickfix = 1 13 | let g:qf_auto_open_loclist = 1 14 | let g:qf_auto_resize = 10 15 | let g:qf_max_height = 20 16 | let g:qf_auto_quit = 1 17 | let g:qf_bufname_or_text = 1 18 | let g:qf_save_win_view = 0 19 | let g:qf_nowrap = 1 20 | let g:qf_shorten_path = 1 21 | -------------------------------------------------------------------------------- /plugin/emmet-vim.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('emmet-vim') 7 | finish 8 | endif 9 | 10 | " let g:user_emmet_mode='n' "only enable normal mode functions. 11 | " let g:user_emmet_mode='inv' "enable all functions, which is equal to 12 | " let g:user_emmet_mode='a' "enable all function in all mode. 13 | let g:user_emmet_mode='i' "enable all function in insert mode. 14 | let g:user_emmet_leader_key='' 15 | let g:user_emmet_install_global = 0 16 | -------------------------------------------------------------------------------- /main/preinit.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | 7 | " source file, avoid long expression{{{ 8 | func! Source(filename) 9 | exec 'source '.expand(a:filename) 10 | endfunction 11 | "}}} 12 | 13 | " guard directory exists, create it if not!{{{ 14 | func! GuardExistDirectory(dir) 15 | if !isdirectory(a:dir) 16 | silent! call mkdir(a:dir, 'p') 17 | endif 18 | endfunc 19 | "}}} 20 | 21 | func! MapMetaCode(key) 22 | exec "set =\e" . a:key 23 | endfunc 24 | -------------------------------------------------------------------------------- /bin/vmore: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | emulate -LR zsh 4 | set -e 5 | # set -x 6 | 7 | if test -t 1; then 8 | if test $# = 0; then 9 | if test -t 0; then 10 | echo "Missing filename" 1>&2 11 | exit 12 | fi 13 | vim -u ~/.vim/.vmorerc -U NONE -i NONE - 14 | else 15 | vim -u ~/.vim/.vmorerc -U NONE -i NONE "$@" 16 | fi 17 | else 18 | # Output is not a terminal, cat arguments or stdin 19 | if test $# = 0; then 20 | if test -t 0; then 21 | echo "Missing filename" 1>&2 22 | exit 23 | fi 24 | cat 25 | else 26 | cat "$@" 27 | fi 28 | fi 29 | -------------------------------------------------------------------------------- /plugin/fastfold.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('FastFold') 7 | finish 8 | endif 9 | 10 | let g:fastfold_force = 0 " 默认只对 syntax 启用本功能, 是否对所有都启用本功能 11 | let g:fastfold_minlines = 0 " 最少行数启用fastfold 功能 12 | let g:fastfold_savehook = 0 " 是否在 save 时自动更新折叠 13 | let g:fastfold_fold_command_suffixes = ['x','X','a','A','o','O','c','C','r','R','m','M','i','n','N'] 14 | let g:fastfold_fold_movement_commands = [']z', '[z', 'zj', 'zk'] 15 | let g:fastfold_skip_filetypes = ['markdown'] 16 | -------------------------------------------------------------------------------- /after/ftplugin/ruby.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal shiftwidth=2 7 | setlocal foldmethod=marker 8 | 9 | " nmap pb (CocoaPodsEditBranch) 10 | " nmap pt (CocoaPodsEditTag) 11 | " nmap pv (CocoaPodsEditVersion) 12 | " nnoremap pu :PodUpdate 13 | " nnoremap pnu :PodUpdateNoRepoUpdate 14 | " nnoremap pi :PodInstall 15 | -------------------------------------------------------------------------------- /plugin/fern-git-status.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('fern-git-status.vim') 7 | finish 8 | endif 9 | " Disable listing ignored files/directories 10 | let g:fern_git_status#disable_ignored = 0 11 | 12 | " Disable listing untracked files 13 | let g:fern_git_status#disable_untracked = 0 14 | 15 | " Disable listing status of submodules 16 | let g:fern_git_status#disable_submodules = 0 17 | 18 | " Disable listing status of directories 19 | let g:fern_git_status#disable_directories = 0 20 | -------------------------------------------------------------------------------- /plugin/markdown-preview.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('markdown-preview.nvim') 7 | finish 8 | endif 9 | 10 | let g:mkdp_auto_start = 0 "打开文件后自动弹出, 0 为否 11 | let g:mkdp_auto_close = 1 "关闭文件后自动关闭预览窗口, 1 为是 12 | let g:mkdp_refresh_slow = 0 "慢速预览, 修改后退出 insert 模式后方会刷新视图, 1 为是 13 | let g:mkdp_open_to_the_world = 0 "开启公网链接, 0 为否 14 | let g:mkdp_browser = '' "指定浏览器, 默认会跟随系统浏览器 15 | let g:mkdp_port = '' " 指定端口, 默认随机端口 16 | let g:mkdp_page_title = '「${name}」' "指定浏览器窗口标题, 默认为 Markdown 文件名 17 | 18 | -------------------------------------------------------------------------------- /plugin/diff.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if &diff 7 | set norelativenumber 8 | set colorcolumn= 9 | 10 | nnoremap dgl :diffget LOCAL 11 | xnoremap dgl :diffget LOCAL 12 | 13 | nnoremap dgb :diffget BASE 14 | xnoremap dgb :diffget BASE 15 | 16 | nnoremap dgr :diffget REMOTE 17 | xnoremap dgr :diffget REMOTE 18 | 19 | nnoremap adgl :%diffget LOCAL 20 | nnoremap adgb :%diffget BASE 21 | nnoremap adgr :%diffget REMOTE 22 | endif 23 | -------------------------------------------------------------------------------- /plugin/vim-auto-popmenu.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-auto-popmenu') 7 | finish 8 | endif 9 | 10 | let g:apc_enable_ft = {'*': 1} 11 | " let g:apc_enable_ft = {'text':1, 'markdown':1, 'php':1} 12 | let g:apc_cr_confirm = 1 " type to use the current keyword 13 | " source for dictionary, current or other loaded buffers, see ':help cpt' 14 | set complete=.,k,w,b 15 | " don't select the first item. 16 | set completeopt=menu,menuone,noselect 17 | " suppress annoy messages. 18 | set shortmess+=c 19 | -------------------------------------------------------------------------------- /after/ftplugin/vim.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal foldmethod=marker 7 | setlocal foldmarker={{{,}}} 8 | 9 | nnoremap gb :PlugBrowse 10 | nnoremap gX :silent call hl#external#OpenVimPluginHomepage('n') 11 | vnoremap gX :silent call hl#external#OpenVimPluginHomepage('v') 12 | 13 | if hl#plug_loaded('vim-lookup') 14 | nnoremap :call lookup#lookup() 15 | nnoremap :call lookup#pop() 16 | endif 17 | -------------------------------------------------------------------------------- /test/test_hl.vim: -------------------------------------------------------------------------------- 1 | let s:suite = themis#suite("hl.vim test suite") 2 | let s:expect = themis#helper('expect') 3 | 4 | let s:scope = themis#helper('scope') 5 | let s:hlvim = s:scope.funcs('autoload/hl.vim') 6 | 7 | function s:suite.test_plug_loaded() 8 | " call s:expect(g:plugs).to_equal({}) 9 | call g:assert.equals(exists('g:plugs'), 0) " calls s:foo() in myfuncs.vim 10 | " call g:assert.equals(hl#plug_loaded('onedark.vim'), 1) " calls s:foo() in myfuncs.vim 11 | endfunction 12 | 13 | function s:suite.test_iso_time() 14 | call s:expect(hl#get#iso_time(1647362029)).to_equal('2022-03-16 00:33:49+0800') 15 | endfunction 16 | 17 | -------------------------------------------------------------------------------- /plugin/cosco.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('cosco.vim') 7 | finish 8 | endif 9 | 10 | let g:auto_comma_or_semicolon = 0 " Default : 0 11 | let g:auto_comma_or_semicolon_events = ['InsertLeave'] 12 | let g:cosco_ignore_comment_lines = 1 " 忽略注释行 13 | " let g:cosco_filetype_whitelist = ['cpp', 'c', 'rust'] 14 | " let g:cosco_filetype_blacklist = ['vim', 'bash'] 15 | " The g:cosco_filetype_whitelist variable will override and ignore the g:cosco_filetype_blacklist variable if both variables are declared in your .vimrc. 16 | -------------------------------------------------------------------------------- /plugin/vimwiki.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vimwiki') 7 | finish 8 | endif 9 | 10 | 11 | let g:vimwiki_global_ext = 0 12 | let g:vimwiki_list = [ 13 | \{'path': '~/repo/hkms', 14 | \ 'syntax': 'markdown', 15 | \ 'ext': '.md', 16 | \ 'auto_export': 0, 17 | \ 'nested_syntaxes': { 18 | \ 'python': 'python', 19 | \ 'c++': 'cpp' 20 | \ } 21 | \} 22 | \] 23 | "" 是否在计算字串长度时用特别考虑中文字符 24 | "let g:vimwiki_CJK_length = 1 25 | "let g:vimwiki_folding = 'expr' 26 | "let g:vimwiki_conceallevel = 1 27 | -------------------------------------------------------------------------------- /plugin/nerdtree.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('nerdtree') 7 | finish 8 | endif 9 | 10 | let g:NERDTreeMapMenu='mn' 11 | let g:NERDTreeChDirMode=1 12 | let g:NERDTreeShowBookmarks=1 "显示书签 13 | let g:NERDTreeIgnore=['\~$', '\.pyc$', '\.swp$'] "设置忽略文件类型 14 | let g:NERDTreeWinSize=40 "窗口大小 15 | let g:NERDTreeDirArrowExpandable = '▸' 16 | let g:NERDTreeDirArrowCollapsible = '▾' 17 | let g:NERDTreeShowHidden = 1 18 | let g:NERDTreeAutoDeleteBuffer = 1 19 | let g:NERDTreeAutoCenter = 0 20 | let g:NERDTreeQuitOnOpen=1 21 | let g:NERDTreeHijackNetrw=0 22 | -------------------------------------------------------------------------------- /plugin/vim-sneak.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-sneak') 7 | finish 8 | endif 9 | 10 | let g:sneak#label = 1 11 | 12 | let g:sneak#f_reset = 1 13 | let g:sneak#t_reset = 1 14 | let g:sneak#s_next = 1 15 | let g:sneak#absolute_dir = 0 16 | let g:sneak#use_ic_scs = 0 17 | let g:sneak#map_netrw = 1 18 | let g:sneak#label_esc = "\" 19 | let g:sneak#target_labels = ';sftunq/SFGHLTUNRMQZ?0' 20 | let g:sneak#prompt = '>' 21 | 22 | map f Sneak_s 23 | map F Sneak_S 24 | xmap f Sneak_s 25 | xmap F Sneak_S 26 | omap z Sneak_s 27 | omap Z Sneak_S 28 | -------------------------------------------------------------------------------- /plugin/tagbar.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('tagbar') 7 | finish 8 | endif 9 | 10 | let g:tagbar_type_markdown = { 11 | \ 'ctagstype': 'markdown', 12 | \ 'ctagsbin' : '~/.vim/plugged/markdown2ctags/markdown2ctags.py', 13 | \ 'ctagsargs' : '-f - --sort=yes ', 14 | \ 'kinds' : [ 15 | \ 's:sections', 16 | \ 'i:images' 17 | \ ], 18 | \ 'sro' : '|', 19 | \ 'kind2scope' : { 20 | \ 's' : 'section', 21 | \ }, 22 | \ 'sort': 0, 23 | \ } 24 | -------------------------------------------------------------------------------- /after/ftplugin/floaterm.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " function! s:SetFloatermMappings() 7 | " " tnoremap FloatermKill 8 | " " tnoremap let b:floaterm_opener = "edit" \| call feedkeys("l", "i") 9 | " tnoremap let b:floaterm_opener = "tabedit" \| call feedkeys("l", "i") 10 | " tnoremap let b:floaterm_opener = "vsplit" \| call feedkeys("l", "i") 11 | " tnoremap let b:floaterm_opener = "split" \| call feedkeys("l", "i") 12 | " endfunction 13 | 14 | " call s:SetFloatermMappings() 15 | -------------------------------------------------------------------------------- /plugin/bracey.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('bracey.vim') 7 | finish 8 | endif 9 | 10 | " let g:bracey_browser_command = "open -a 'Google Chrome'" 11 | " let g:bracey_browser_command = "open -a 'Chrome'" 12 | let g:bracey_browser_command = "open -a Safari" 13 | let g:bracey_auto_start_browser = 1 14 | let g:bracey_refresh_on_save = 0 15 | let g:bracey_eval_on_save = 1 16 | let g:bracey_auto_start_server = 1 17 | let g:bracey_server_allow_remote_connections = 0 18 | let g:bracey_server_port = 33954 19 | let g:bracey_server_path = 'http://127.0.0.1' 20 | let g:bracey_server_log = '/tmp/bracey_server_logfile' 21 | -------------------------------------------------------------------------------- /plugin/vim-dict.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-dict') 7 | finish 8 | endif 9 | " Add additional dict folders 10 | let g:vim_dict_dict = [ 11 | \ '~/.vim/dict', 12 | \ ] 13 | 14 | " File type override 15 | let g:vim_dict_config = { 16 | \ 'html':'html,javascript,css', 17 | \ 'markdown': 'text', 18 | \ 'plantuml': 'text', 19 | \ 'bash': 'bash,sh', 20 | \ 'zsh': 'zsh,sh', 21 | \ 'gitcommit': 'gitcommit,text' 22 | \ } 23 | 24 | " " Disable certain types 25 | " let g:vim_dict_config = {'text': ''} 26 | -------------------------------------------------------------------------------- /plugin/synstatics.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('synstatics') 7 | finish 8 | endif 9 | 10 | "let g:syntastic_error_symbol='>>' 11 | "let g:syntastic_warning_symbol='>' 12 | "let g:syntastic_check_on_open=0 13 | "let g:syntastic_check_on_wq=0 14 | "let g:syntastic_javascript_checkers = ['jsl', 'jshint'] 15 | "let g:syntastic_html_checkers=['tidy', 'jshint'] 16 | ""let g:syntastic_auto_loc_list = 1 "强制显示错误于下方 17 | "let g:syntastic_always_populate_loc_list = 1 18 | "set statusline+=%#warningmsg# 19 | "set statusline+=%{SyntasticStatuslineFlag()} 20 | "set statusline+=%* 21 | "let g:syntastic_swift_checkers = ['swiftpm', 'swiftlint'] 22 | 23 | -------------------------------------------------------------------------------- /after/syntax/html.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " ref: https://vi.stackexchange.com/a/2333/30077 7 | " syntax region htmlFold start="<\z(\<\(area\|base\|br\|col\|command\|embed\|hr\|img\|input\|keygen\|link\|meta\|para\|source\|track\|wbr\>\)\@![a-z-]\+\>\)\%(\_s*\_[^/]\?>\|\_s\_[^>]*\_[^>/]>\)" end="" fold transparent keepend extend containedin=htmlHead,htmlH\d 8 | 9 | " syntax region htmlFold start="<\z(p\|h\d\|i\?frame\|table\|colgroup\|thead\|tfoot\|tbody\|t[dhr]\|pre\|[diou]l\|li\|span\|div\|head\|script\|style\|blockquote\|form\)\%(\_s*\_[^/]\?>\|\_s\_[^>]*\_[^>/]>\)" end="" fold transparent keepend extend containedin=htmlHead,htmlH\d 10 | 11 | -------------------------------------------------------------------------------- /plugin/vim-flutter.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-flutter') 7 | finish 8 | endif 9 | 10 | let g:flutter_command = 'flutter' 11 | let g:flutter_hot_reload_on_save = 1 12 | let g:flutter_hot_restart_on_save = 0 13 | let g:flutter_show_log_on_run = 'split' 14 | let g:flutter_show_log_on_attach = 'split' 15 | let g:flutter_autoscroll = 1 16 | " g:flutter_use_last_run_option - When set to 1 then :FlutterRun will use the arguments from the previous call when no arguments are specified. 17 | " g:flutter_use_last_attach_option - Identical to g:flutter_use_last_run_option but affecting the :FlutterAttach command. 18 | let g:flutter_close_on_quit = 1 19 | -------------------------------------------------------------------------------- /plugin/vim-floaterm.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-floaterm') 7 | finish 8 | endif 9 | 10 | let g:floaterm_shell = &shell 11 | let g:floaterm_title = 'floaterm: $1/$2' 12 | let g:floaterm_wintype = 'float' 13 | let g:floaterm_position = 'center' 14 | let g:floaterm_width = 0.9 15 | let g:floaterm_height = 0.8 16 | let g:floaterm_borderchars = '─│─│┌┐┘└' 17 | let g:floaterm_rootmarkers = g:hl_rootmarkers 18 | " let g:floaterm_opener = 'tabe' " opener can be configured by command 'FloatermNew --opener=tabe lf' 19 | let g:floaterm_opener = 'edit' 20 | let g:floaterm_autoclose = 1 21 | let g:floaterm_autohide = 1 22 | let g:floaterm_autoinsert = v:true 23 | -------------------------------------------------------------------------------- /plugin/asynctasks.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('asynctasks.vim') 7 | finish 8 | endif 9 | 10 | " let g:asynctasks_term_pos = 'bottom' " 只有 output 为 terminal, 这里的 term_pos 才有用 11 | let g:asynctasks_term_pos = 'quickfix' " 只有 output 为 terminal, 这里的 term_pos 才有用 12 | let g:asynctasks_term_reuse = 1 13 | let g:asynctasks_term_focus = 0 14 | let g:asynctasks_term_rows = 10 " 设置纵向切割时,高度为 10 15 | let g:asynctasks_term_cols = 80 " 设置横向切割时,宽度为 80 16 | let g:asynctasks_rtp_config = 'tasks.ini' 17 | let g:asynctasks_config_name = '.tasks' 18 | let g:asynctasks_extra_config = [] " will load extra config after ~/.vim/tasks.ini 19 | let g:asynctasks_term_hidden = 1 20 | -------------------------------------------------------------------------------- /after/ftplugin/json.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | let total_line = line('$') 7 | if (total_line < 100000) 8 | setlocal foldmethod=syntax 9 | endif 10 | " nmap zA 11 | 12 | command! -range=% -nargs=0 -buffer RemoveComment let s:view = winsaveview() | silent! , call hl#json#RemoveComment() | call winrestview(s:view) 13 | 14 | command! -range=% -nargs=0 -buffer CompactJSON silent , !jq -c 15 | command! -range=% -nargs=0 -buffer MinifyJSON silent , !jq -c 16 | 17 | command! -range=% -nargs=0 -buffer FormatJSON silent , !jq --indent 4 18 | command! -range=% -nargs=0 -buffer PrettifyJSON silent , !jq --indent 4 19 | -------------------------------------------------------------------------------- /plugin/indent-guides.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-indent-guides') 7 | finish 8 | endif 9 | 10 | " "***************** nathanaelkane/vim-indent-guides **************** 11 | " let g:indent_guides_enable_on_vim_startup = 1 "是否在启动时自动运行 12 | " let g:indent_guides_guide_size = 1 "设置缩进线宽度, 1 个字符 13 | " let g:indent_guides_start_level = 2 "启动等级 14 | " let g:indent_guides_exclude_filetypes = ['help', 'nerdtree', 'startify'] "在某些类型中不设置缩进线 15 | " let g:indent_guides_auto_colors = 1 "控制缩进线是否使用默认颜色, 最好使用, 否则缩进线中的圆点会被突出显示. 如果确定不使用的话需要在下方命令中指定颜色 16 | " "autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=#373737 ctermbg=3 17 | " "autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#373737 ctermbg=4 18 | 19 | -------------------------------------------------------------------------------- /plugin/netrw.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | "***************** netrw **************************** 7 | let g:netrw_hide = 0 "设置默认隐藏 8 | let g:netrw_liststyle = 0 " tree 模式显示风格 9 | let g:netrw_banner = 0 " 显示帮助信息 10 | let g:netrw_browse_split = 0 "控制 直接在当前窗口打开光标下文件 11 | let g:netrw_winsize = 30 " 占用宽度 12 | let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+' " 需要隐藏的文件 13 | let g:netrw_altv = 1 " 控制 v 分裂的窗口位于右边 14 | let g:netrw_preview = 1 " 默认是水平分割, 此项设置使之垂直分割 15 | let g:netrw_alto = 0 " 控制预览窗口位于左侧或右侧, 与 netrw_preview 共同作用 16 | let g:netrw_keepdir=0 17 | let g:netrw_special_syntax=1 18 | let g:netrw_localcopydircmd = 'cp -r' 19 | let g:netrw_nogx = 1 " disable gx keymap 20 | " let g:netrw_browsex_viewer='open' 21 | " let g:netrw_fastbrowse = 0 22 | " let g:netrw_chgwin = 2 " 控制按下 的新文件在位于屏幕右侧的 2 号窗口打开, Lex 默认会设为 2 23 | -------------------------------------------------------------------------------- /plugin/autopairs.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('auto-pairs') 7 | finish 8 | endif 9 | 10 | let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`', '```':'```', '"""':'"""', "'''":"'''"} 11 | " let g:AutoPairs['<']='>' 12 | " let g:AutoPairs = {'[':']', '{':'}',"'":"'",'"':'"', '`':'`'} 13 | let g:AutoPairsMultilineClose = 1 14 | let g:AutoPairsMoveCharacter = "()[]{}\"'" 15 | let g:AutoPairsShortcutToggle = '' 16 | let g:AutoPairsShortcutFastWrap = '' 17 | let g:AutoPairsShortcutJump = '' 18 | let g:AutoPairsShortcutBackInsert = '' 19 | let g:AutoPairsFlyMode = 0 " 可以严格匹配括号, 跨越多行进行跳转 20 | let g:AutoPairsMapBS = 1 21 | let g:AutoPairsMapCh = 1 22 | let g:AutoPairsMapSpace = 1 23 | let g:AutoPairsMapCR = 0 24 | " inoremap ) =AutoPairsInsert(')') 25 | -------------------------------------------------------------------------------- /plugin/indentline.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('indentLine') 7 | finish 8 | endif 9 | 10 | let g:indentLine_char = '|' " 设置缩进线字符 11 | let g:indentLine_concealcursor = 'inc' " 默认设置, 设置隐藏字符在何种模式下隐藏, i 为 insert, n 为 normal, v 为 visual 12 | let g:indentLine_conceallevel = 1 " 此为默认插件强制且默认选项, 默认设置为 1, 如果设置为0 则缩进线插件不会生效, 等价于设置 set conceallevel=1, 系统一共有四级, 0~3 13 | let g:indentLine_fileTypeExclude = ['txt', 'markdown', 'json', 'jsonc', 'json5', 'csv', 'asciiart', 'rst'] " 排除类型 14 | let g:indentLine_bufNameExclude = ['_.*', '*.md', '*.json', '*.jsonc', '*.json5', '*.csv', '*.asciiart', '*.rst'] 15 | let g:indentLine_bufTypeExclude = ['help', 'terminal', 'markdown', 'json', 'jsonc', 'json5', 'csv', 'asciiart', 'rst'] 16 | let g:indentLine_color_term = 239 17 | let g:indentLine_color_gui = '#4D4D4D' 18 | -------------------------------------------------------------------------------- /plugin/nerdcommenter.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('nerdcommenter') 7 | finish 8 | endif 9 | 10 | " let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation 11 | " let g:NERDAltDelims_c = 1 " 必须设置, 否则下面的自定义不会起作用 12 | " let g:NERDAltDelims_swift = 1 " 必须设置, 否则下面的自定义不会起作用 13 | " let g:NERDCustomDelimiters = { 14 | " \'c': { 'left': '//', 'right': ''}, 15 | " \'swift': { 'left': '//' }, 16 | " \} 17 | " let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region) 18 | " let g:NERDTrimTrailingWhitespace = 1 " Enable trimming of trailing whitespace when uncommenting 19 | " let g:NERDToggleCheckAllLines = 1 " Enable NERDCommenterToggle to check all selected lines is commented or not 20 | -------------------------------------------------------------------------------- /autoload/vim_snippets.vim: -------------------------------------------------------------------------------- 1 | " this is well known Filename found in snipmate (and the other engines), but 2 | " rewritten and documented :) 3 | " 4 | " optional arg1: string in which to replace '$1' by filename with extension 5 | " and path dropped. Defaults to $1 6 | " optional arg2: return this value if buffer has no filename 7 | " But why not use the template in this case, too? 8 | " Doesn't make sense to me 9 | fun! vim_snippets#Filename(...) 10 | let template = get(a:000, 0, "$1") 11 | let arg2 = get(a:000, 1, "") 12 | 13 | let basename = expand('%:t:r') 14 | 15 | if basename == '' 16 | return arg2 17 | else 18 | return substitute(template, '$1', basename, 'g') 19 | endif 20 | endf 21 | 22 | " original code: 23 | " fun! Filename(...) 24 | " let filename = expand('%:t:r') 25 | " if filename == '' | return a:0 == 2 ? a:2 : '' | endif 26 | " return !a:0 || a:1 == '' ? filename : substitute(a:1, '$1', filename, 'g') 27 | " endf 28 | -------------------------------------------------------------------------------- /autoload/hl/sql.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | function! hl#sql#query_text_obj() abort 7 | " It switches to visual mode and searches for the next ; character. 8 | " searches forward for the next ; character or the ending of the file 9 | call search("\\(;\\|\\%$\\)", "cWz") 10 | " and then search backward for the previous ; character or the beginning of the file 11 | call search("\\(;\\|\\%^\\)", "bsW") 12 | " Finally, it moves one character forward to position the cursor correctly. 13 | call search("^.", "cWz") 14 | execute "normal! vg`'" 15 | endfunction 16 | 17 | if hl#plug_loaded('vim-dadbod-ui') 18 | function! hl#sql#execute_current_query() 19 | let b:view = winsaveview() 20 | call hl#sql#query_text_obj() 21 | execute "normal \(DBUI_ExecuteQuery)" 22 | call winrestview(b:view) 23 | endfunction 24 | endif 25 | -------------------------------------------------------------------------------- /plugin/inline_edit.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('inline_edit.vim') 7 | finish 8 | endif 9 | 10 | " let g:inline_edit_new_buffer_command = 'tabnew' " 使用了 tempfile 后, 本选项就无效了 11 | let g:inline_edit_new_buffer_command = 'rightbelow vertical new' 12 | let g:inline_edit_proxy_type = 'tempfile' " 使用 temptfile 可以执行外部命令, 缺点是可能会有一些异常的 bug 13 | " let g:inline_edit_proxy_type = 'scratch' 14 | let g:inline_edit_autowrite = 1 15 | let g:inline_edit_modify_statusline = 0 " 使用 tempfile 之后, statusline 基本不会有变化, 可以直接禁用了 16 | 17 | " let g:inline_edit_patterns = [ 18 | " \{ 19 | " \ 'main_filetype': 'vim', 20 | " \ 'sub_filetype': 'vim', 21 | " \ 'indent_adjustment': 1, 22 | " \ 'start': '\', 23 | " \ 'end': '\' 24 | " \ } 25 | " \ ] 26 | -------------------------------------------------------------------------------- /plugin/terminal_help.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-terminal-help') 7 | finish 8 | endif 9 | 10 | let g:terminal_key = '' 11 | let g:terminal_cwd = 1 " initialize working dir: 0 for unchanged, 1 for file path and 2 for project root. 12 | let g:terminal_height = 10 " new terminal height, default to 10. 13 | let g:terminal_pos = 'rightbelow' " where to open the terminal, default to rightbelow. 14 | let g:terminal_shell = 'zsh' " specify shell rather than default one. 15 | let g:terminal_edit = 'tabnew' "command to open the file in vim, default to tab drop. 16 | let g:terminal_kill = 'exit' " set to term to kill term session when exiting vim. 17 | let g:terminal_list = 0 " set to 0 to hide terminal buffer in the buffer list. 18 | let g:terminal_fixheight = 1 " set to 1 to set winfixheight for the terminal window. 19 | let g:terminal_close = 1 " set to 1 to close window if process finished. 20 | -------------------------------------------------------------------------------- /after/ftplugin/sql.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " sql query text object 7 | vnoremap aq :call hl#sql#query_text_obj() 8 | onoremap aq :call hl#sql#query_text_obj() 9 | 10 | if hl#plug_loaded('vim-dadbod-ui') 11 | " nmap qe (DBUI_ExecuteQuery) 12 | nmap qe :call hl#sql#execute_current_query() 13 | vmap qe (DBUI_ExecuteQuery) 14 | nmap qs (DBUI_SaveQuery) 15 | " nmap qe (DBUI_EditBindParameters) 16 | endif 17 | 18 | if g:is_in_macvim_gui && hl#plug_loaded('vim-dadbod-ui') 19 | nmap :call hl#sql#execute_current_query() 20 | vmap (DBUI_ExecuteQuery) 21 | endif 22 | " if hl#plug_loaded('vim-dadbod') 23 | " nmap db#op_exec() 24 | " xmap db#op_exec() 25 | " endif 26 | -------------------------------------------------------------------------------- /ftdetect/jsonc.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | augroup JSONCDetect 7 | au! 8 | autocmd BufNewFile,BufRead *.cjson setlocal filetype=jsonc 9 | autocmd BufNewFile,BufRead coc-settings.json setlocal filetype=jsonc 10 | autocmd BufNewFile,BufRead *.jsonc setfiletype jsonc 11 | autocmd BufNewFile,BufRead .eslintrc.json setlocal filetype=jsonc 12 | autocmd BufNewFile,BufRead .babelrc setlocal filetype=jsonc 13 | autocmd BufNewFile,BufRead .jshintrc setlocal filetype=jsonc 14 | autocmd BufNewFile,BufRead .jslintrc setlocal filetype=jsonc 15 | autocmd BufNewFile,BufRead .mocharc.json setlocal filetype=jsonc 16 | autocmd BufNewFile,BufRead coffeelint.json setlocal filetype=jsonc 17 | autocmd BufNewFile,BufRead tsconfig*.json setlocal filetype=jsonc 18 | autocmd BufNewFile,BufRead jsconfig.json setlocal filetype=jsonc 19 | autocmd BufNewFile,BufRead */.vscode/*.json setlocal filetype=jsonc 20 | augroup END 21 | -------------------------------------------------------------------------------- /plugin/hiPairs.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('hiPairs') 7 | finish 8 | endif 9 | 10 | " 匹配符号样式设置 11 | let g:hiPairs_hl_matchPair = { 'term' : 'underline,bold', 12 | \ 'cterm' : 'bold', 13 | \ 'ctermfg' : '0', 14 | \ 'ctermbg' : '180', 15 | \ 'gui' : 'bold', 16 | \ 'guifg' : 'Black', 17 | \ 'guibg' : '#21D96E' } 18 | " 19 | " 无匹配符号样式设置 20 | let g:hiPairs_hl_unmatchPair = { 'term' : 'underline,italic', 21 | \ 'cterm' : 'italic', 22 | \ 'ctermfg' : '15', 23 | \ 'ctermbg' : '12', 24 | \ 'gui' : 'italic', 25 | \ 'guifg' : 'White', 26 | \ 'guibg' : 'Red' } 27 | 28 | -------------------------------------------------------------------------------- /dict/all.dict: -------------------------------------------------------------------------------- 1 | hanleylee 2 | dict_all 3 | PHP 4 | Sichuan 5 | URLs 6 | OOP 7 | prebuilt 8 | namespace 9 | multifile 10 | wxPython 11 | Jython 12 | CGI 13 | GTK 14 | MFC 15 | Django 16 | IronPython 17 | Tcl 18 | SmallTalk 19 | resave 20 | frontend 21 | CPython 22 | PyPy 23 | IDE 24 | CET 25 | lilydjwg 26 | Lua 27 | Javascript 28 | MySQL 29 | MongoDB 30 | CouchDB 31 | etc 32 | github 33 | blog 34 | MediaWiki 35 | gmail 36 | Gtalk 37 | CSS 38 | SQLite3 39 | CLI 40 | chatroom 41 | pastebin 42 | nginx 43 | mongodb 44 | ejabberd 45 | sshd 46 | mysqld 47 | htop 48 | Fcitx 49 | Zsh 50 | fcitx 51 | vim 52 | InoReader 53 | unsubscribe 54 | snipMate 55 | neocomplcache 56 | neosnippets 57 | neocomplete 58 | Firefox 59 | ascii 60 | nxdomain 61 | SERVFAIL 62 | templating 63 | pacman 64 | GitHub 65 | gitignore 66 | tmpfs 67 | Tencent 68 | Baidu 69 | Alipay 70 | StackOverflow 71 | GFW 72 | SaltStack 73 | Grafana 74 | CN 75 | statsd 76 | Ajithbasha 77 | Hasenali 78 | gitolite 79 | backend 80 | VPS 81 | zsh 82 | filesystems 83 | fsync 84 | logrotate 85 | transles 86 | Wechat 87 | QQ 88 | SegmentFault 89 | -------------------------------------------------------------------------------- /plugin/vim-barbaric.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-barbaric') 7 | finish 8 | endif 9 | 10 | " The IME to invoke for managing input languages (macos, fcitx, ibus, xkb-switch) 11 | let g:barbaric_ime = 'macos' 12 | 13 | " The input method for Normal mode (as defined by `xkbswitch -g`, `ibus engine`, or `xkb-switch -p`) 14 | let g:barbaric_default = 0 15 | 16 | " The scope where alternate input methods persist (buffer, window, tab, global) 17 | let g:barbaric_scope = 'buffer' 18 | 19 | " Forget alternate input method after n seconds in Normal mode (disabled by default) 20 | " Useful if you only need IM persistence for short bursts of active work. 21 | let g:barbaric_timeout = -1 22 | 23 | " The fcitx-remote binary (to distinguish between fcitx and fcitx5) 24 | " let g:barbaric_fcitx_cmd = 'fcitx5-remote' 25 | 26 | " The xkb-switch library path (for Linux xkb-switch users ONLY) 27 | " let g:barbaric_libxkbswitch = $HOME . '/.local/lib/libxkbswitch.so' 28 | -------------------------------------------------------------------------------- /autoload/hl/netrw.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " Better keymaps for Netrw{{{ 7 | function! hl#netrw#map() 8 | endfunction 9 | "}}} 10 | 11 | " Delete a non-empty directory{{{ 12 | function! hl#netrw#remove_recursive() 13 | if &filetype ==# 'netrw' 14 | " Prepare the delete command. 15 | " Make it so that is triggered by just pressing Enter 16 | cnoremap rm -r 17 | 18 | " Unmark all files (don't want to delete anything by accident) 19 | normal mu 20 | 21 | " Mark the file/directory under the cursor 22 | normal mf 23 | 24 | " Show the prompt to enter the command 25 | " In here you either press Enter to confirm or press ctrl + c to abort. 26 | " Don't do anything else! 27 | try 28 | normal mx 29 | catch 30 | echo "Canceled" 31 | endtry 32 | 33 | " Undo the Enter keymap 34 | cunmap 35 | endif 36 | endfunction 37 | "}}} 38 | -------------------------------------------------------------------------------- /autoload/gruvbox.vim: -------------------------------------------------------------------------------- 1 | " ----------------------------------------------------------------------------- 2 | " File: gruvbox.vim 3 | " Description: Retro groove color scheme for Vim 4 | " Author: morhetz 5 | " Source: https://github.com/morhetz/gruvbox 6 | " Last Modified: 09 Apr 2014 7 | " ----------------------------------------------------------------------------- 8 | 9 | function! gruvbox#invert_signs_toggle() 10 | if g:gruvbox_invert_signs == 0 11 | let g:gruvbox_invert_signs=1 12 | else 13 | let g:gruvbox_invert_signs=0 14 | endif 15 | 16 | colorscheme gruvbox 17 | endfunction 18 | 19 | " Search Highlighting {{{ 20 | 21 | function! gruvbox#hls_show() 22 | set hlsearch 23 | call GruvboxHlsShowCursor() 24 | endfunction 25 | 26 | function! gruvbox#hls_hide() 27 | set nohlsearch 28 | call GruvboxHlsHideCursor() 29 | endfunction 30 | 31 | function! gruvbox#hls_toggle() 32 | if &hlsearch 33 | call gruvbox#hls_hide() 34 | else 35 | call gruvbox#hls_show() 36 | endif 37 | endfunction 38 | 39 | " }}} 40 | 41 | " vim: set sw=2 ts=2 sts=2 et tw=80 ft=vim fdm=marker: 42 | -------------------------------------------------------------------------------- /autoload/hl/asynctasks.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | function! hl#asynctasks#fzf_task() 7 | let rows = asynctasks#source(&columns * 48 / 100) 8 | let source = [] 9 | for row in rows 10 | let name = row[0] 11 | let source += [name . ' ' . row[1] . ' : ' . row[2]] 12 | endfor 13 | let opts = { 'source': source, 'sink': function('s:fzf_sink'), 14 | \ 'options': '+m --nth 1 --inline-info --tac' } 15 | if exists('g:fzf_layout') 16 | for key in keys(g:fzf_layout) 17 | let opts[key] = deepcopy(g:fzf_layout[key]) 18 | endfor 19 | endif 20 | call fzf#run(opts) 21 | endfunction 22 | 23 | function! s:fzf_sink(what) 24 | let p1 = stridx(a:what, '<') 25 | if p1 >= 0 26 | let name = strpart(a:what, 0, p1) 27 | let name = substitute(name, '^\s*\(.\{-}\)\s*$', '\1', '') 28 | if name != '' 29 | exec "AsyncTask ". fnameescape(name) 30 | endif 31 | endif 32 | endfunction 33 | 34 | -------------------------------------------------------------------------------- /pythonx/javascript_snippets.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Helper utilities to format javascript snippets. 5 | """ 6 | 7 | ALWAYS = 'always' 8 | NEVER = 'never' 9 | 10 | 11 | def get_option(snip, option, default=None): 12 | return snip.opt('g:ultisnips_javascript["{}"]'.format(option), default) 13 | 14 | 15 | def semi(snip): 16 | option = get_option(snip, 'semi', ALWAYS) 17 | 18 | if option == NEVER: 19 | ret = '' 20 | elif option == ALWAYS: 21 | ret = ';' 22 | else: 23 | ret = ';' 24 | return ret 25 | 26 | 27 | def space_before_function_paren(snip): 28 | option = get_option(snip, 'space-before-function-paren', NEVER) 29 | 30 | if option == NEVER: 31 | ret = '' 32 | elif option == ALWAYS: 33 | ret = ' ' 34 | else: 35 | ret = '' 36 | return ret 37 | 38 | 39 | def keyword_spacing(snip): 40 | option = get_option(snip, 'keyword-spacing', ALWAYS) 41 | 42 | if option == NEVER: 43 | ret = '' 44 | elif option == ALWAYS: 45 | ret = ' ' 46 | else: 47 | ret = '' 48 | return ret 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Hanley Lee 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.vmorerc: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | exec 'source ' . expand('$HOME/.vim/main/preinit.vim') 7 | 8 | "███████████████████████ Source Load File ██████████████████████████{{{ 9 | 10 | "======================= Variable ============================ 11 | silent! call Source('$HOME/.vim/main/variable.vim') 12 | 13 | "======================= Options ============================ 14 | silent! call Source('$HOME/.vim/main/options.vim') 15 | 16 | "======================= Terminal Keycode ============================ 17 | if g:is_in_term 18 | silent! call Source('$HOME/.vim/main/term_keycode.vim') 19 | endif 20 | 21 | "======================= Appearance ============================ 22 | silent! call Source('$HOME/.vim/main/appearance.vim') 23 | 24 | "======================= Main =================================={{{ 25 | set nomodifiable " Only in version 6.0 26 | set readonly 27 | 28 | "======================= Keymap ============================={{{ 29 | nnoremap :q! 30 | nnoremap q :q! 31 | "}}} 32 | 33 | " vim:set ft=vim sw=4 ts=4 tw=150: 34 | -------------------------------------------------------------------------------- /plugin/vim-cpp-enhanced-highlight.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-cpp-enhanced-highlight') 7 | finish 8 | endif 9 | 10 | " Highlighting of class scope, disabled by default 11 | let g:cpp_class_scope_highlight = 1 12 | 13 | " Highlighting of member variables, disabled by default. 14 | let g:cpp_member_variable_highlight = 1 15 | 16 | " Highlighting of class names in declarations, disabled by default. 17 | let g:cpp_class_decl_highlight = 1 18 | 19 | " Highlighting of POSIX functions, disabled by default. 20 | let g:cpp_posix_standard = 1 21 | 22 | " works in most cases, but can be a little slow on large files. 23 | " let g:cpp_experimental_simple_template_highlight = 1 24 | 25 | " faster implementation but has some corner cases where it doesn't work 26 | let g:cpp_experimental_template_highlight = 1 27 | 28 | " highlight the keywords concept and requires as well as all named requirements (like DefaultConstructible) in the standard library. 29 | let g:cpp_concepts_highlight = 1 30 | 31 | " Highlighting of user defined functions can be disabled 32 | " let g:cpp_no_function_highlight = 1 33 | -------------------------------------------------------------------------------- /plugin/signify.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-signify') 7 | finish 8 | endif 9 | 10 | let g:signify_disable_by_default = 0 11 | 12 | let g:signify_realtime = 0 13 | let g:signify_line_highlight = 0 14 | let g:signify_vcs_list = [ 'git', 'hg' ] 15 | let g:signify_update_on_bufenter = 1 16 | 17 | let g:signify_skip_filetype = { '***': 1 } 18 | let g:signify_skip_filename = { '/home/user/.vimrc': 1 } 19 | let g:signify_skip_filename_pattern = [ 'foo.*bar', 'tmp' ] 20 | 21 | let g:signify_vcs_cmds = { 22 | \ 'git': 'git diff --no-color --no-ext-diff -U0 -- %f', 23 | \ 'svn': 'svn diff --diff-cmd %d -x -U0 -- %f' 24 | \ } 25 | 26 | g:signify_vcs_cmds_diffmode 27 | 28 | let g:signify_sign_add = '+' 29 | let g:signify_sign_delete = '_' 30 | let g:signify_sign_delete_first_line = '-' 31 | let g:signify_sign_change = '~' 32 | let g:signify_sign_change_delete = g:signify_sign_change . g:signify_sign_delete_first_line 33 | let g:signify_sign_show_count = 1 34 | 35 | let g:signify_difftool = 'diff' 36 | let g:signify_fold_context = [3, 8] 37 | let g:signify_priority = 10 38 | -------------------------------------------------------------------------------- /plugin/leaderf.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('LeaderF') 7 | finish 8 | endif 9 | 10 | ""去ff翻目录所以如果需要搜索的话就是用 Alfred 搜索, Leaderf 11 | ""仅作为打开历史jj记录文件工具 12 | "let g:Lf_UseCache = 1 "使用缓存 13 | "let g:Lf_WindowPosition = 'popup' "默认使用 popup 窗口弹出搜索结果 14 | "let g:Lf_PreviewInPopup = 1 "在 popup 窗口中预览文件 15 | "let g:Lf_CommandMap = {'': [''], '': ['']} "使用上下方向按键进行上下移动焦点 16 | "let g:Lf_PopupHeight = 0.7 17 | "let g:Lf_PopupWidth = 0.9 18 | "let g:Lf_ShowDevIcons = 1 19 | "let g:Lf_DevIconsFont = "YaHei Consolas Icon Hybrid" 20 | "let g:Lf_CacheDirectory = '~/.vim/LeaderF' 21 | ""set ambiwidth=double 22 | "let g:Lf_WildIgnore = { 23 | " \ 'dir': ['~/data/00_repo/04_hanleylee.com/source'], 24 | " \ 'file': [] 25 | " \} 26 | "let g:Lf_MruFileExclude = ['*.so', '~/hl/00_repo/04_hanleylee.com/source/_posts/*'] 27 | ""let g:Lf_HistoryExclude = { 28 | "" \ 'cmd': [], 29 | "" \ 'search': [] 30 | "" \} 31 | ""let g:Lf_StlSeparator = { 'left': "\ue0b0", 'right': "\ue0b2", 'font': "DejaVu Sans Mono for Powerline" } 32 | ""let g:Lf_PreviewResult = {'Function': 0, 'BufTag': 0 } 33 | 34 | -------------------------------------------------------------------------------- /plugin/colorizer.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('Colorizer') 7 | finish 8 | endif 9 | 10 | let g:colorizer_auto_color = 0 11 | 12 | let g:colorizer_colornames_disable = 1 13 | let g:colorizer_auto_filetype='css,html' 14 | let g:colorizer_skip_comments = 1 15 | let g:colorizer_colornames = 1 16 | let g:colorizer_x11_names = 0 17 | let g:colorizer_syntax = 0 18 | let g:colorizer_fgcontrast = 1 19 | " let g:colorizer_hex_pattern = ['#', '\%(\x\{3}\|\x\{6}\)', ''] 20 | " let g:colorizer_hex_pattern = ['rgb:', '\%(\x\x\/\x\x\/\x\x\)', ''] 21 | " let g:colorizer_custom_colors = { 'blue': '#ff0000'} 22 | " let g:colorizer_disable_bufleave = 1 23 | " let g:colorizer_ = 0 24 | " let g:colorizer_conceal_cursor_mode='nv' 25 | 26 | let g:colorizer_auto_map = 1 27 | " cC Colorizer Toggle highlighting of Colors. In visual mode it only highlights the colors in the selected region (normal and visual mode). 28 | " cT ColorContrast Cycle through contrast setting :ColorContrast (normal and visual mode) 29 | " cF ColorFgBg Toggle foreground and background color :ColorSwapFgBg 30 | -------------------------------------------------------------------------------- /plugin/vim-test.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-test') 7 | finish 8 | endif 9 | 10 | " let test#strategy = 'floaterm' 11 | let test#strategy = 'asyncrun' 12 | " let test#strategy = { 13 | " \ 'nearest': 'neovim', 14 | " \ 'file': 'dispatch', 15 | " \ 'suite': 'basic', 16 | " \} 17 | 18 | " Some strategies clear the screen before executing the test command, but you can disable this: 19 | " let g:test#preserve_screen = 1 20 | 21 | " let g:test#echo_command = 1 22 | 23 | let test#vim#term_position = 'belowright' 24 | 25 | let test#filename_modifier = ':.' " test/models/user_test.rb (default) 26 | " let test#filename_modifier = ':p' " /User/janko/Code/my_project/test/models/user_test.rb 27 | " let test#filename_modifier = ':~' " ~/Code/my_project/test/models/user_test.rb 28 | 29 | " Runners available are 'pytest', 'nose', 'nose2', 'djangotest', 'djangonose', 'mamba', and Python's built-in unittest as 'pyunit' 30 | let test#python#runner = 'pytest' 31 | let test#java#runner = 'gradletest' 32 | let test#scala#runner = 'blooptest' 33 | let test#go#runner = 'ginkgo' 34 | let test#vim#runner = 'themis' 35 | let g:test#javascript#runner = 'jest' 36 | 37 | let test#php#phpunit#executable = 'php artisan test' 38 | -------------------------------------------------------------------------------- /plugin/asyncrun.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('asyncrun.vim') 7 | finish 8 | endif 9 | 10 | let g:asyncrun_exit = "silent call system('afplay ~/.vim/crystal.aiff &')" 11 | let g:asyncrun_mode = 0 " This option indicates how to start the job. 12 | let g:asyncrun_wrapper = '' " This can be used to setup a command prefix. 13 | let g:asyncrun_rootmarks = g:hl_rootmarkers 14 | let g:asyncrun_open = 10 " 自动打开 quickfix window, 高度为 10 15 | let g:asyncrun_bell = 1 " 任务结束时候响铃提醒 16 | let g:asyncrun_encs = '' " Job stdout/stderr encoding 17 | let g:asyncrun_trim='' " non-zero to trim the empty lines in the quickfix window. 18 | let g:asyncrun_auto='' " event name to trigger QuickFixCmdPre/QuickFixCmdPost 19 | " let g:asyncrun_save=2 20 | let g:asyncrun_timer=50 " how many messages should be inserted into quickfix every 100ms interval 21 | let g:asyncrun_local=0 " Set to 1 to use local errorformat, standard output/error of child process will be matched by local errorformat if g:asyncrun_local is set to 1 22 | let g:asyncrun_shell='' " Specify shell executable. 23 | let g:asyncrun_shellflag='' " Specify shell flags. by default, AsyncRun will use vim's shellcmdflag option to config shell flags, it can be overrided without changing your &shellcmdflag 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotvim 2 | 3 | My Vim configuration 4 | 5 | ## What is this repository for? 6 | 7 | You can visit my configuration for **inspiration**! 8 | 9 | ## How I use it? 10 | 11 | I just put `.vimrc` file on `$HOME`, and set contents of `$HOME/.vimrc` as below 12 | 13 | ```bash 14 | source ~/.vim/vimrc 15 | ``` 16 | 17 | This repository is my `$HOME/.vim/` directory 18 | 19 | ## Dependency 20 | 21 | - [MacVim](https://github.com/macvim-dev/macvim) 22 | - package-manager: [vim-plug](https://github.com/junegunn/vim-plug) 23 | - font: [Yahei-Fira-Icon-Hybrid-Font](https://github.com/hanleylee/yahei-fira-icon-hybrid-font) 24 | - os: MacOS 25 | 26 | ## Most Used Plugin 27 | 28 | - fuzzy finder: [fzf.vim](https://github.com/junegunn/fzf.vim) 29 | - completion: [coc.nvim](https://github.com/neoclide/coc.nvim) 30 | - theme: [onedark.vim](https://github.com/joshdick/onedark.vim) 31 | - statusline: [lightline.vim](https://github.com/itchyny/lightline.vim) 32 | - markdwon syntax: [vim-markdown](https://github.com/plasticboy/vim-markdown) 33 | - file finder: [fern](https://github.com/lambdalisue/fern.vim) 34 | - terminal: [vim-floaterm](https://github.com/voldikss/vim-floaterm) 35 | - project manage: [asynctasks.vim](https://github.com/skywind3000/asynctasks.vim) 36 | - ... 37 | 38 | ## Preview 39 | 40 | ![start](./img/start.png) 41 | 42 | More screenshot [here](./PREVIEW.md)... 43 | -------------------------------------------------------------------------------- /autoload/floaterm/wrapper/hl_yazi.vim: -------------------------------------------------------------------------------- 1 | function! floaterm#wrapper#hl_yazi#(cmd, jobopts, config) abort 2 | let s:yazi_tmpfile = tempname() 3 | let original_dir = getcwd() 4 | lcd %:p:h 5 | 6 | let cmdlist = split(a:cmd) 7 | let cmd = 'yazi --chooser-file "' . s:yazi_tmpfile . '"' 8 | if len(cmdlist) > 1 9 | let cmd .= ' ' . join(cmdlist[1:], ' ') 10 | else 11 | if !has_key(a:config, 'cwd') 12 | if glob('%') != '' 13 | let cmd .= ' "' . expand('%:p') . '"' 14 | else 15 | let cmd .= ' "' . getcwd() . '"' 16 | endif 17 | endif 18 | endif 19 | 20 | exe "lcd " . original_dir 21 | let cmd = [&shell, &shellcmdflag, cmd] 22 | let jobopts = {'on_exit': funcref('s:hl_yazi_callback')} 23 | call floaterm#util#deep_extend(a:jobopts, jobopts) 24 | return [v:false, cmd] 25 | endfunction 26 | 27 | function! s:hl_yazi_callback(job, data, event, opener) abort 28 | if filereadable(s:yazi_tmpfile) 29 | let filenames = readfile(s:yazi_tmpfile) 30 | if !empty(filenames) 31 | if has('nvim') 32 | call floaterm#window#hide(bufnr('%')) 33 | endif 34 | let locations = [] 35 | for filename in filenames 36 | let dict = {'filename': fnamemodify(filename, ':p')} 37 | call add(locations, dict) 38 | endfor 39 | call floaterm#util#open(locations, a:opener) 40 | endif 41 | endif 42 | endfunction 43 | -------------------------------------------------------------------------------- /main/path.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | let paths_arr = [ 7 | \ 'include', 8 | \ 'src/include', 9 | \ $C_INCLUDE_PATH, 10 | \ $CPLUS_INCLUDE_PATH, 11 | \ $OBJC_INCLUDE_PATH, 12 | \ $CPATH, 13 | \ $PYTHONPATH, 14 | \ ] 15 | call hl#util#ExpandPathFromEnv(paths_arr) 16 | 17 | let s:vim_bin_path = expand('$HOME/.vim/bin') 18 | let $PATH=s:vim_bin_path.':'.$PATH 19 | " let s:llvm_path = expand('$HOMEBREW_PREFIX/opt/llvm/bin') 20 | " if isdirectory(s:llvm_path) 21 | " let $PATH=s:llvm_path.':'.$PATH 22 | " endif 23 | 24 | " if hl#plug_loaded('ultisnips') 25 | 26 | " call UltiSnips#bootstrap#Bootstrap() 27 | " if exists('g:_uspy') 28 | " " Expand our path to use python lib and functions 29 | " let s:SourcedFile=expand('') 30 | " exec g:_uspy 'import vim, os, sys' 31 | " exec g:_uspy "sourced_file = vim.eval('s:SourcedFile')" 32 | " exec g:_uspy "while not os.path.exists(os.path.join(sourced_file, 'pythonx')): sourced_file = os.path.dirname(sourced_file)" 33 | " exec g:_uspy "module_path = os.path.join(sourced_file, 'pythonx')" 34 | " exec g:_uspy 'sys.path.append(module_path)' 35 | " end 36 | 37 | " endif 38 | " set runtimepath^=/Users/hanley/repo/vim/coc-gitcomp 39 | 40 | -------------------------------------------------------------------------------- /plugin/tablemode.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-table-mode') 7 | finish 8 | endif 9 | 10 | let g:table_mode_corner='|' "设置转角处为 `|`, 如果设为其他比如`+`, Markdown 语法不支持 11 | let g:table_mode_delimiter = ',' 12 | let g:table_mode_align_char = ':' 13 | let g:table_mode_syntax = 1 14 | let g:table_mode_auto_align = 1 15 | let g:table_mode_update_time = 500 16 | let g:table_mode_disable_tableize_mappings = 0 17 | let g:table_mode_tableize_auto_border = 0 18 | let g:table_mode_ignore_align = 0 19 | 20 | " let g:table_mode_motion_up_map = '{' 21 | " let g:table_mode_motion_down_map = '}' 22 | " let g:table_mode_motion_left_map = '[' 23 | " let g:table_mode_motion_right_map = ']' 24 | " let g:table_mode_cell_text_object_a_map = 'a' 25 | " let g:table_mode_cell_text_object_i_map = 'i' 26 | " let g:table_mode_realign_map = 'tr' 27 | " let g:table_mode_delete_row_map = 'tdd' 28 | " let g:table_mode_delete_column_map = 'tdc' 29 | " let g:table_mode_insert_column_before_map = 'tiC' 30 | " let g:table_mode_insert_column_after_map = 'tic' 31 | " let g:table_mode_add_formula_map = 'tfa' 32 | " let g:table_mode_eval_formula_map = 'tfe' 33 | " let g:table_mode_echo_cell_map = 't?' 34 | " let g:table_mode_sort_map = 'ts' 35 | " let g:table_mode_tableize_map = 'tt' 36 | -------------------------------------------------------------------------------- /plugin/rainbow.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('rainbow') 7 | finish 8 | endif 9 | 10 | " let g:rainbow_active = 1 11 | " let g:rainbow_conf = { 12 | " \ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick'], 13 | " \ 'ctermfgs': ['lightblue', 'lightyellow', 'lightcyan', 'lightmagenta'], 14 | " \ 'guis': [''], 15 | " \ 'cterms': [''], 16 | " \ 'operators': '_,_', 17 | " \ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'], 18 | " \ 'separately': { 19 | " \ '*': {}, 20 | " \ 'markdown': { 21 | " \ 'parentheses_options': 'containedin=markdownCode contained', 22 | " \ }, 23 | " \ 'lisp': { 24 | " \ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick', 'darkorchid3'], 25 | " \ }, 26 | " \ 'haskell': { 27 | " \ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/\v\{\ze[^-]/ end=/}/ fold'], 28 | " \ }, 29 | " \ 'vim': { 30 | " \ 'parentheses_options': 'containedin=vimFuncBody', 31 | " \ }, 32 | " \ 'perl': { 33 | " \ 'syn_name_prefix': 'perlBlockFoldRainbow', 34 | " \ }, 35 | " \ 'stylus': { 36 | " \ 'parentheses': ['start=/{/ end=/}/ fold contains=@colorableGroup'], 37 | " \ }, 38 | " \ 'css': 0, 39 | " \ } 40 | " \} 41 | -------------------------------------------------------------------------------- /plugin/vim-sandwich.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-sandwich') 7 | finish 8 | endif 9 | 10 | " let g:sandwich#recipes += [ 11 | " \ ] 12 | 13 | let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes) 14 | let g:sandwich#recipes += [ 15 | \ { 16 | \ 'buns' : ['TagInput(1)', 'TagInput(0)'], 17 | \ 'expr' : 1, 18 | \ 'filetype': ['html'], 19 | \ 'kind' : ['add', 'replace'], 20 | \ 'action' : ['add'], 21 | \ 'input' : ['t'], 22 | \ }, 23 | \ { 24 | \ 'buns' : ['abc', 'bca'], 25 | \ 'kind' : ['add'], 26 | \ 'action' : ['add'], 27 | \ 'input' : ['B'], 28 | \ }, 29 | \ { 30 | \ 'buns' : ['abc', 'bca'], 31 | \ 'kind': ['delete'], 32 | \ 'action' : ['delete'], 33 | \ 'input' : ['B'], 34 | \ }, 35 | \ { 36 | \ 'buns' : ['**', '**'], 37 | \ 'input' : ['q'], 38 | \ 'filetype': ['markdown'], 39 | \ }, 40 | \ ] 41 | 42 | function! TagInput(is_head) abort 43 | if a:is_head 44 | let s:TagLast = input('Tag: ') 45 | if s:TagLast !=# '' 46 | let tag = printf('<%s>', s:TagLast) 47 | else 48 | throw 'OperatorSandwichCancel' 49 | endif 50 | else 51 | let tag = printf('', matchstr(s:TagLast, '^\a[^[:blank:]>/]*')) 52 | endif 53 | return tag 54 | endfunction 55 | -------------------------------------------------------------------------------- /init.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | " Vim 配置原则: 6 | " 1. 一定要了解此项能实现什么功能再配置 7 | " 2. 没有必要的插件能不装就不装, 尽量用 Vim 原生功能 8 | 9 | exec 'source ' . expand('$HOME/.vim/main/preinit.vim') 10 | 11 | "███████████████████████ Source Load File ██████████████████████████{{{ 12 | 13 | "======================= Variable ============================ 14 | call Source('$HOME/.vim/main/variable.vim') 15 | 16 | "======================= Options ============================ 17 | call Source('$HOME/.vim/main/options.vim') 18 | 19 | "======================= Plugin ============================ 20 | call Source('$HOME/.vim/main/plugin.vim') 21 | 22 | "======================= Path ============================ 23 | call Source('$HOME/.vim/main/path.vim') 24 | 25 | "======================= Terminal Keycode ============================ 26 | if g:is_in_term 27 | call Source('$HOME/.vim/main/term_keycode.vim') 28 | endif 29 | 30 | "======================= GUI Keycode ============================ 31 | call Source('$HOME/.vim/main/gui_keymap.vim')" 32 | 33 | "======================= Keymap ============================ 34 | call Source('$HOME/.vim/main/keymap.vim') 35 | 36 | "======================= Command ============================ 37 | call Source('$HOME/.vim/main/command.vim') 38 | 39 | "======================= Auto ============================ 40 | call Source('$HOME/.vim/main/autocmd.vim') 41 | 42 | "======================= Appearance ============================ 43 | call Source('$HOME/.vim/main/appearance.vim') 44 | "}}} 45 | -------------------------------------------------------------------------------- /plugin/conflict-marker.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('conflict-marker.vim') 7 | finish 8 | endif 9 | 10 | " Default values 11 | let g:conflict_marker_begin = '^<<<<<<< \@=' 12 | let g:conflict_marker_common_ancestors = '^||||||| .*$' 13 | let g:conflict_marker_separator = '^=======$' 14 | let g:conflict_marker_end = '^>>>>>>> \@=' 15 | let g:conflict_marker_enable_highlight = 1 16 | " let g:conflict_marker_highlight_group = 'Error' 17 | " disable the default highlight group 18 | let g:conflict_marker_highlight_group = '' 19 | 20 | " Include text after begin and end markers 21 | " let g:conflict_marker_begin = '^<<<<<<< .*$' 22 | " let g:conflict_marker_end = '^>>>>>>> .*$' 23 | 24 | let g:conflict_marker_enable_mappings = 1 " [x and ]x mappings are defined as default, ct for theirs, co for ours, cn for none and cb for both 25 | let g:conflict_marker_enable_matchit = 1 " % mapping is extended by matchit.vim 26 | 27 | highlight ConflictMarkerBegin guibg=#2f7366 28 | highlight ConflictMarkerOurs guibg=#2e5049 29 | highlight ConflictMarkerTheirs guibg=#344f69 30 | highlight ConflictMarkerEnd guibg=#2f628e 31 | highlight ConflictMarkerCommonAncestorsHunk guibg=#754a81 32 | 33 | augroup HLConflictMarkerDetect 34 | autocmd! 35 | autocmd BufReadPost,FileChangedShellPost,ShellFilterPost,StdinReadPost * if conflict_marker#detect#markers() 36 | \ | call s:on_detected() 37 | \ | endif 38 | augroup END 39 | 40 | function! s:on_detected() 41 | nunmap [xx 42 | nunmap ]xx 43 | endfunction 44 | -------------------------------------------------------------------------------- /plugin/nerdtree-git-plugin.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('nerdtree-git-plugin') 7 | finish 8 | endif 9 | 10 | let g:NERDTreeGitStatusEnable = 1 11 | let g:NERDTreeGitStatusUseNerdFonts = 0 " you should install nerdfonts by yourself. default: 0 12 | let g:NERDTreeGitStatusShowIgnored = 1 " a heavy feature may cost much more time. default: 0 13 | let g:NERDTreeGitStatusUntrackedFilesMode = 'all' " a heavy feature too. default: normal 14 | let g:NERDTreeGitStatusGitBinPath = 'git' " default: git (auto find in path) 15 | let g:NERDTreeGitStatusShowClean = 0 " default: 0 16 | let g:NERDTreeGitStatusDirDirtyOnly = 1 17 | let g:NERDTreeGitStatusAlignIfConceal = 1 18 | let g:NERDTreeGitStatusUpdateOnCursorHold = 1 19 | let g:NERDTreeGitStatusUpdateOnWrite = 1 20 | let g:NERDTreeGitStatusLogLevel = 2 21 | let g:NERDTreeGitStatusMapNextHunk = ']h' 22 | let g:NERDTreeGitStatusMapPrevHunk = '[h' 23 | let g:NERDTreeGitStatusPorcelainVersion = 2 24 | let g:NERDTreeGitStatusConcealBrackets = 1 " default: 0, DO NOT enable this feature if you have also installed vim-devicons. 25 | let g:NERDTreeGitStatusIndicatorMapCustom = { 26 | \ 'Modified' :'✹', 27 | \ 'Staged' :'✚', 28 | \ 'Untracked' :'✭', 29 | \ 'Renamed' :'➜', 30 | \ 'Unmerged' :'═', 31 | \ 'Deleted' :'✖', 32 | \ 'Dirty' :'✗', 33 | \ 'Ignored' :'☒', 34 | \ 'Clean' :'✔︎', 35 | \ 'Unknown' :'?', 36 | \ } 37 | -------------------------------------------------------------------------------- /autoload/hl/coc.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " function! s:check_back_space() abort 7 | " let col = col('.') - 1 8 | " return !col || getline('.')[col - 1] =~# '\s' 9 | " endfunction 10 | 11 | " highlight current cursor{{{ 12 | function hl#coc#highlight_current_cursor() 13 | let ft = &filetype 14 | if ft !=? 'markdown' 15 | \ && ft !=? 'csv' 16 | \ && ft !=? 'txt' 17 | call CocActionAsync('highlight') 18 | endif 19 | endfunction 20 | "}}} 21 | 22 | function! hl#coc#disable_for_type() 23 | " if index(g:coc_filetypes_enable, &filetype) == -1 24 | " :silent! CocDisable 25 | " else 26 | " :silent! CocEnable 27 | " endif 28 | if index(g:coc_disable_file_types, &filetype) != -1 29 | let b:coc_enabled = 0 30 | endif 31 | endfunction 32 | 33 | function! hl#coc#disable_for_large_file() 34 | let total_line = line('$') 35 | let total_column = col('$') 36 | let file_size = getfsize(expand('%')) 37 | 38 | if (total_line > g:coc_max_acceptable_line) 39 | \ || (total_column > g:coc_max_acceptable_column) 40 | \ || (file_size> g:coc_max_acceptable_size || file_size == -2) 41 | let b:coc_enabled = 0 42 | endif 43 | endfunction 44 | 45 | function! hl#coc#disable_for_specific_pattern() 46 | let file_name = hl#fs#getFullPathName() 47 | for pattern in g:coc_disbale_file_patterns 48 | if match(file_name, pattern) != -1 49 | let b:coc_enabled = 0 50 | break 51 | endif 52 | endfor 53 | endfunction 54 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "hanleylee/coc-gitcomp"] 2 | path = hanleylee/coc-gitcomp 3 | url = git@github.com:hanleylee/coc-gitcomp.git 4 | [submodule "hanleylee/vim-alternate"] 5 | path = hanleylee/vim-alternate 6 | url = git@github.com:hanleylee/vim-alternate.git 7 | [submodule "hanleylee/vim-asciiart"] 8 | path = hanleylee/vim-asciiart 9 | url = git@github.com:hanleylee/vim-asciiart.git 10 | [submodule "hanleylee/vim-blockmove"] 11 | path = hanleylee/vim-blockmove 12 | url = git@github.com:hanleylee/vim-blockmove.git 13 | [submodule "hanleylee/vim-cocoapods"] 14 | path = hanleylee/vim-cocoapods 15 | url = git@github.com:hanleylee/vim-cocoapods.git 16 | [submodule "hanleylee/vim-gitignore"] 17 | path = hanleylee/vim-gitignore 18 | url = git@github.com:hanleylee/vim-gitignore.git 19 | [submodule "hanleylee/vim-markdown"] 20 | path = hanleylee/vim-markdown 21 | url = git@github.com:hanleylee/vim-markdown.git 22 | [submodule "hanleylee/vim-renamer"] 23 | path = hanleylee/vim-renamer 24 | url = git@github.com:hanleylee/vim-renamer.git 25 | [submodule "hanleylee/vim-stconvert"] 26 | path = hanleylee/vim-stconvert 27 | url = git@github.com:hanleylee/vim-stconvert.git 28 | [submodule "hanleylee/vim-taskpaper"] 29 | path = hanleylee/vim-taskpaper 30 | url = git@github.com:hanleylee/vim-taskpaper.git 31 | [submodule "hanleylee/vim-togglecursor"] 32 | path = hanleylee/vim-togglecursor 33 | url = git@github.com:hanleylee/vim-togglecursor.git 34 | ; vim:set noexpandtab tabstop=4 shiftwidth=4 tw=150: 35 | [submodule "hanleylee/hlvimlib"] 36 | path = hanleylee/hlvimlib 37 | url = git@github.com:hanleylee/hlvimlib.git 38 | [submodule "hanleylee/vim-rst"] 39 | path = hanleylee/vim-rst 40 | url = git@github.com:hanleylee/vim-rst.git 41 | -------------------------------------------------------------------------------- /plugin/vim-dadbod-ui.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-dadbod-ui') 7 | finish 8 | endif 9 | 10 | let g:db_ui_save_location = expand('$HL_REPO/database/db_ui_queries') 11 | let g:db_ui_execute_on_save = 0 12 | let g:dbs = [ 13 | \ {'name': 'MongoDB', 'url': 'mongodb://127.0.0.1:27017'}, 14 | \ {'name': 'MySQL', 'url': 'mysql://root@localhost:3306'}, 15 | \ ] 16 | 17 | let g:db_ui_table_helpers = { 18 | \ 'postgresql': { 19 | \ 'List': 'SELECT * FROM "{table}" ORDER BY id ASC;' 20 | \ }, 21 | \ 'mysql': { 22 | \ 'List': 'SELECT * FROM {table} LIMIT 200;' 23 | \ } 24 | \ } 25 | let g:db_ui_auto_execute_table_helpers = 1 26 | 27 | let g:db_ui_icons = { 28 | \ 'expanded': '▾', 29 | \ 'collapsed': '▸', 30 | \ 'saved_query': '*', 31 | \ 'new_query': '+', 32 | \ 'tables': '~', 33 | \ 'buffers': '»', 34 | \ 'connection_ok': '✓', 35 | \ 'connection_error': '✕', 36 | \ } 37 | let g:db_ui_show_help = 0 38 | let g:db_ui_winwidth = 50 39 | let g:db_ui_disable_mappings = 0 40 | " let g:db_ui_disable_mappings_dbui = 1 " Disable mappings in DBUI drawer 41 | " let g:db_ui_disable_mappings_dbout = 1 " Disable mappings in DB output 42 | let g:db_ui_disable_mappings_sql = 0 " Disable mappings in SQL buffers 43 | " let g:db_ui_disable_mappings_javascript = 1 " Disable mappings in Javascript buffers (for Mongodb) 44 | let g:db_ui_force_echo_notifications=1 45 | let g:db_ui_disable_progress_bar = 1 46 | -------------------------------------------------------------------------------- /plugin/fern.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('fern.vim') 7 | finish 8 | endif 9 | 10 | let g:fern_disable_startup_warnings = 1 11 | let g:fern#disable_default_mappings = 1 12 | let g:fern#renderer#default#leading = ' ' 13 | let g:fern#renderer#default#root_symbol = '┬ ' 14 | let g:fern#renderer#default#leaf_symbol = '├─ ' 15 | let g:fern#renderer#default#collapsed_symbol = '├─ ' 16 | let g:fern#renderer#default#expanded_symbol = '├┬ ' 17 | let g:fern#mark_symbol = '*' 18 | 19 | let g:fern#profile = 0 20 | let g:fern#logfile = v:null 21 | " let g:fern#loglevel = g:fern#ERROR 22 | let g:fern#opener = 'edit' 23 | let g:fern#hide_cursor = 1 24 | let g:fern#keepalt_on_edit = 0 25 | let g:fern#keepjumps_on_edit = 0 26 | 27 | let g:fern#disable_viewer_spinner = 0 28 | let g:fern#disable_viewer_auto_duplication = 0 29 | let g:fern#disable_drawer_auto_winfixwidth = 0 30 | let g:fern#disable_drawer_auto_resize = 0 31 | let g:fern#disable_drawer_smart_quit = 0 32 | let g:fern#disable_drawer_auto_restore_focus = 0 33 | let g:fern#default_hidden = 1 34 | let g:fern#default_include = '' " A default |String| pattern used to filter nodes (include). 35 | let g:fern#default_exclude = '' " A default |String| pattern used to filter nodes (exclude). 36 | " let g:fern#renderer = 'default' 37 | let g:fern#comparator = 'default' " A |String| name of comparator used to sort tree items. Allowed value 38 | let g:fern#drawer_width = 50 " A |Number| width of drawer in default. 39 | let g:fern#drawer_keep = v:false 40 | let g:fern#scheme#file#show_absolute_path_on_root_label = 1 41 | let g:fern#disable_auto_buffer_delete = 0 42 | let g:fern#disable_auto_buffer_rename = 0 43 | 44 | -------------------------------------------------------------------------------- /plugin/vim-markdown.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-markdown') 7 | finish 8 | endif 9 | 10 | " For preservim/vim-markdown {{{ 11 | let g:vim_markdown_folding_disabled = 1 "太耗费性能 12 | let g:vim_markdown_folding_level = 3 "文件打开时显示的目录总级别 13 | let g:vim_markdown_folding_style_pythonic = 1 14 | let g:vim_markdown_auto_insert_bullets = 0 "换行时自动插入项目符号 15 | let g:vim_markdown_new_list_item_indent = 0 " 在排序项目上按 o 换行出现的缩进 16 | let g:vim_markdown_edit_url_in = 'tab' 17 | let g:vim_markdown_conceal = 1 " To disable conceal regardless of 'conceallevel' setting, use 0 18 | let g:vim_markdown_conceal_code_blocks = 0 " 对代码不取消隐藏符号 19 | let g:vim_markdown_strikethrough = 1 " 加删除线 20 | let g:vim_markdown_toc_autofit = 1 21 | let g:vim_markdown_fenced_languages = ['c++=cpp', 'viml=vim', 'bash=sh', 'ini=dosini'] 22 | " let g:vim_markdown_no_default_key_mappings = 1 23 | let g:vim_markdown_follow_anchor = 0 24 | " let g:vim_markdown_math = 1 25 | let g:vim_markdown_frontmatter = 1 26 | let g:vim_markdown_toml_frontmatter = 1 27 | let g:vim_markdown_json_frontmatter = 1 28 | " let g:vim_markdown_no_extensions_in_markdown = 1 29 | let g:vim_markdown_autowrite = 1 30 | " let g:vim_markdown_auto_extension_ext = 'txt' 31 | " }}} 32 | 33 | " For tpope/vim-markdown {{{ 34 | " let g:markdown_fenced_languages = [ 35 | " \ 'html', 36 | " \ 'python', 37 | " \ 'bash=sh', 38 | " \ 'c', 39 | " \ 'cpp', 40 | " \ 'swift', 41 | " \ 'json', 42 | " \ 'xml', 43 | " \ 'ini=dosini', 44 | " \ 'ruby', 45 | " \ ] 46 | " let g:markdown_minlines = 100 47 | " let g:markdown_folding = 1 48 | " let g:markdown_syntax_conceal = 1 49 | " }}} 50 | -------------------------------------------------------------------------------- /after/ftplugin/dart.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | setlocal shiftwidth=2 7 | 8 | function! s:IsFlutterProject() 9 | " Get the directory of the current file 10 | let l:dir = expand('%:p:h') 11 | 12 | " Loop to check each directory upwards 13 | while l:dir !=# '/' 14 | let file_path_to_check = l:dir . '/pubspec.yaml' 15 | " Check if pubspec.yaml exists in the current directory 16 | if filereadable(file_path_to_check) 17 | let l:lines = readfile(file_path_to_check) 18 | let l:content = join(l:lines, "\n") 19 | let l:flutter_sdk_pattern = 'sdk:\s\+flutter' 20 | 21 | " Search for the pattern in the content 22 | if l:content =~ l:flutter_sdk_pattern 23 | return 1 24 | endif 25 | endif 26 | 27 | " Move to the parent directory 28 | let l:dir = fnamemodify(l:dir, ':h') 29 | endwhile 30 | 31 | " Return 0 if no pubspec.yaml is found 32 | return 0 33 | endfunction 34 | 35 | if hl#plug_loaded('vim-flutter') && s:IsFlutterProject() 36 | " Some of these key choices were arbitrary; 37 | " it's just an example. 38 | nnoremap Fs :FlutterRun 39 | nnoremap Fa :FlutterAttach 40 | nnoremap Fr :FlutterHotReload 41 | nnoremap FR :FlutterHotRestart 42 | nnoremap FD :FlutterVisualDebug 43 | nnoremap Fq :FlutterQuit 44 | 45 | if g:is_in_macvim_gui 46 | " Enable Flutter menu 47 | call FlutterMenu() 48 | nnoremap :FlutterHotReload 49 | nnoremap :FlutterHotRestart 50 | endif 51 | 52 | endif 53 | -------------------------------------------------------------------------------- /autoload/hl/buffer.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | 7 | function! hl#buffer#GetBuffersByEditTime() 8 | " 获取所有缓冲区信息 9 | let buffers = [] 10 | let bufnrs = filter(range(1, bufnr('$')), 'buflisted(v:val) && getbufvar(v:val, "&filetype") != "qf"') 11 | let bufinfo = map(bufnrs, 'getbufinfo(v:val)[0]') 12 | 13 | " 排序缓冲区,根据 buffer 的最后编辑时间, 最近修改的排第一 14 | call sort(bufinfo, {a, b -> b.lastused - a.lastused}) 15 | 16 | " 构造结果字符串 17 | for buf in bufinfo 18 | call add(buffers, buf.bufnr) 19 | endfor 20 | 21 | return buffers 22 | endfunction 23 | 24 | function! hl#buffer#frontmostFilePath() 25 | let l:buffers = hl#buffer#GetBuffersByEditTime() 26 | " 初始化文件路径为空 27 | let l:filepath = '' 28 | 29 | " 遍历所有窗口 30 | for l:buf_id in l:buffers 31 | " 获取窗口的 buftype 32 | let l:win_buftype = getbufvar(winbufnr(l:buf_id), '&buftype') 33 | 34 | " 检查是否为 floaterm 类型 35 | if l:win_buftype == 'terminal' 36 | " 跳过 floaterm 窗口 37 | continue 38 | endif 39 | 40 | " 获取缓冲区对应的文件路径 41 | let l:bufname = bufname(l:buf_id) 42 | let l:filepath = fnamemodify(l:bufname, ':p') 43 | 44 | " 如果文件路径不为空,跳出循环 45 | if l:filepath != '' 46 | " 返回文件路径 47 | return l:filepath 48 | endif 49 | endfor 50 | 51 | echoerr 'invalid buffers' 52 | return 'invalid buffers' 53 | endfunction 54 | 55 | function! hl#buffer#openFile(open_type, path) 56 | call hl#buffer#HideFloaterm() 57 | execute a:open_type . ' ' . a:path 58 | endfunction 59 | 60 | function! hl#buffer#HideFloaterm() 61 | if &buftype ==# 'terminal' && &filetype ==# 'floaterm' 62 | execute "FloatermHide" 63 | else 64 | " Not a terminal buffer, do nothing 65 | endif 66 | endfunction 67 | -------------------------------------------------------------------------------- /autoload/hl/get.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | function! hl#get#titlestr() abort 7 | let l:title_str = '' 8 | if g:is_linux 9 | let l:title_str = hostname() . ' ' 10 | endif 11 | let l:title_str = l:title_str . expand('%:p:~') . ' ' 12 | if &buflisted 13 | let l:title_str = l:title_str . strftime('%Y-%m-%d %H:%M',getftime(expand('%'))) 14 | endif 15 | 16 | return l:title_str 17 | endfunction 18 | 19 | " Output current time or unix timestamp in human-readable format. 20 | function! hl#get#iso_time(timestamp) abort 21 | if a:timestamp 22 | return strftime('%Y-%m-%d %H:%M:%S%z', a:timestamp) 23 | endif 24 | 25 | return strftime('%Y-%m-%d %H:%M:%S%z') 26 | endfunction 27 | 28 | " 获取可读的文件大小 29 | function hl#get#readble_fsize(file) 30 | let size = getfsize(a:file) 31 | if has('python3') 32 | try 33 | py3 from myutils import filesize 34 | return py3eval('filesize('.size.')') 35 | catch /.*/ 36 | endtry 37 | endif 38 | return size . 'B' 39 | endfunction 40 | 41 | func hl#get#indent_level() 42 | return indent('.') / &shiftwidth 43 | endfunction 44 | 45 | " 返回当前日期的中文表示 46 | function hl#get#zh_date() 47 | let d = strftime("%Y年%m月%d日") 48 | let d = substitute(d, '[年月]\@<=0', '', 'g') 49 | return d 50 | endfunction 51 | 52 | func hl#get#current_syntax() 53 | let current_syntax = synIDattr(synIDtrans(synID(line("."), col("$")-1, 1)), "name") 54 | return current_syntax 55 | endfunction 56 | 57 | let s:secret_config = '' 58 | func hl#get#secret_config() 59 | if empty(s:secret_config) 60 | let file = expand('$HL_SECRET/config.json') 61 | if filereadable(file) 62 | let s:secret_config = json_decode(join(readfile(expand('$HL_SECRET/config.json')), '')) 63 | endif 64 | endif 65 | return s:secret_config 66 | endfunction 67 | 68 | -------------------------------------------------------------------------------- /unused/run.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | "silent w 7 | "if &filetype ==? 'c' 8 | " "exec 'AsyncRun gcc % -o build/%< && ./build/%<' "花了一晚上研究出来的可用方案 9 | " "exec 'AsyncRun gcc -Wall -O2 "$(VIM_FILEPATH)" -o "$(VIM_FILEDIR)/build/$(VIM_FILENOEXT)" && ./build/"$(VIM_FILENOEXT)"' 10 | " AsyncRun! gcc `pkg-config --cflags --libs glib-2.0` -Wall -O2 "$(VIM_FILEPATH)" -o "$HOME/.cache/build/c/$(VIM_FILENOEXT)" && "$HOME/.cache/build/c/$(VIM_FILENOEXT)" 11 | "elseif &filetype ==? 'cpp' 12 | " " exec 'AsyncRun! g++ -stdc++11 % -o %<; time ./%<' 13 | " AsyncRun! clang++ -Wall -std=c++11 "$(VIM_FILEPATH)" -o "$XDG_CACHE_HOME/build/cpp/$(VIM_FILENOEXT)" && "$XDG_CACHE_HOME/build/cpp/$(VIM_FILENOEXT)" 14 | "elseif &filetype ==? 'objc' 15 | " AsyncRun! clang -framework Foundation "$(VIM_FILEPATH)" -o "$XDG_CACHE_HOME/build/objc/$(VIM_FILENOEXT)" && "$XDG_CACHE_HOME/build/objc/$(VIM_FILENOEXT)" 16 | "elseif &filetype ==? 'java' 17 | " AsyncRun! javac %; time java %< 18 | "elseif &filetype ==? 'sh' 19 | " AsyncRun! time bash % 20 | "elseif &filetype ==? 'lua' 21 | " AsyncRun! time % 22 | "elseif &filetype ==? 'perl' 23 | " AsyncRun! time % 24 | "elseif &filetype ==? 'ruby' 25 | " AsyncRun! time % 26 | "elseif &filetype ==? 'javascript' 27 | " AsyncRun! time node % 28 | "elseif &filetype ==? 'swift' 29 | " AsyncRun! swiftc -o "$HOME/.cache/build/swift/$(VIM_FILENOEXT)" "$(VIM_FILEPATH)" && "$HOME/.cache/build/swift/$(VIM_FILENOEXT)" 30 | "elseif &filetype ==? 'python' 31 | " AsyncRun! time python3 % 32 | "elseif &filetype ==? 'html' 33 | " silent !open % 34 | "elseif &filetype ==? 'xhtml' 35 | " silent !open % 36 | "elseif &filetype ==? 'go' 37 | " AsyncRun! go build %<; time go run % 38 | "elseif &filetype ==? 'vim' 39 | " source % 40 | "elseif &filetype ==? 'markdown' 41 | " silent MarkdownPreview 42 | "else 43 | " echoerr 'Current filetype is not supported!' 44 | "endif 45 | -------------------------------------------------------------------------------- /plugin/vim-devicons.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-devicons') 7 | finish 8 | endif 9 | 10 | let g:webdevicons_enable = 1 11 | 12 | let g:WebDevIconsUnicodeDecorateFolderNodes = 1 13 | 14 | " adding the flags to NERDTree 15 | let g:webdevicons_enable_nerdtree = 1 16 | 17 | " adding the custom source to unite 18 | let g:webdevicons_enable_unite = 1 19 | 20 | " adding the column to vimfiler 21 | let g:webdevicons_enable_vimfiler = 1 22 | 23 | " adding to vim-airline's tabline 24 | let g:webdevicons_enable_airline_tabline = 1 25 | 26 | " adding to vim-airline's statusline 27 | let g:webdevicons_enable_airline_statusline = 1 28 | 29 | " ctrlp glyphs 30 | let g:webdevicons_enable_ctrlp = 1 31 | 32 | " adding to vim-startify screen 33 | let g:webdevicons_enable_startify = 1 34 | 35 | " adding to flagship's statusline 36 | let g:webdevicons_enable_flagship_statusline = 1 37 | 38 | " turn on/off file node glyph decorations (not particularly useful) 39 | let g:WebDevIconsUnicodeDecorateFileNodes = 1 40 | 41 | " use double-width(1) or single-width(0) glyphs 42 | " only manipulates padding, has no effect on terminal or set(guifont) font 43 | let g:WebDevIconsUnicodeGlyphDoubleWidth = 1 44 | 45 | " whether or not to show the nerdtree brackets around flags 46 | let g:webdevicons_conceal_nerdtree_brackets = 1 47 | 48 | " the amount of space to use after the glyph character (default ' ') 49 | let g:WebDevIconsNerdTreeAfterGlyphPadding = ' ' 50 | 51 | " Force extra padding in NERDTree so that the filetype icons line up vertically 52 | let g:WebDevIconsNerdTreeGitPluginForceVAlign = 1 53 | 54 | " Adding the custom source to denite 55 | let g:webdevicons_enable_denite = 1 56 | 57 | " the amount of space to use after the glyph character in vim-airline 58 | let g:WebDevIconsTabAirLineAfterGlyphPadding = ' ' 59 | 60 | " the amount of space to use before the glyph character in vim-airline 61 | let g:WebDevIconsTabAirLineBeforeGlyphPadding = ' ' 62 | -------------------------------------------------------------------------------- /plugin/gitgutter.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-gitgutter') 7 | finish 8 | endif 9 | 10 | let g:gitgutter_enabled = 1 11 | let g:gitgutter_map_keys = 0 12 | let g:gitgutter_signs = 1 13 | let g:gitgutter_max_signs = 500 " 最大显示 diff 数量, 超过这个值就不显示任何 diff 了 14 | let g:gitgutter_async = 1 "默认使用异步, 但是实际效果与同步差别几乎没有 15 | let g:gitgutter_log = 0 16 | " let g:gitgutter_highlight_lines = 1 "高亮修改的行 17 | " let g:gitgutter_highlight_linenrs = 1 "To turn on line number highlighting by default 18 | " set signcolumn=yes "默认情况下会自动显示, 亦可通过本选项强制开启 19 | " let g:gitgutter_sign_added = '+' "自定义 add 的字符 20 | " let g:gitgutter_sign_modified = '~' 21 | let g:gitgutter_sign_added = '┃' 22 | let g:gitgutter_sign_modified = '┃' 23 | let g:gitgutter_sign_removed = '_' 24 | let g:gitgutter_sign_removed_first_line = '‾' 25 | let g:gitgutter_sign_removed_above_and_below = '_¯' 26 | let g:gitgutter_sign_modified_removed = '~_' 27 | let g:gitgutter_sign_priority = 10 28 | let g:gitgutter_sign_allow_clobber = 1 29 | let g:gitgutter_set_sign_backgrounds = 0 30 | 31 | let g:gitgutter_git_executable = 'git' 32 | " let g:gitgutter_git_args = '' 33 | " let g:gitgutter_diff_args = '' 34 | " let g:gitgutter_diff_relative_to = '' 35 | let g:gitgutter_diff_base = 'HEAD' "diff against any commit 36 | let g:gitgutter_grep = 'grep' 37 | 38 | let g:gitgutter_show_msg_on_hunk_jumping = 1 39 | 40 | let g:gitgutter_preview_win_floating = 0 41 | let g:gitgutter_preview_win_location = 'bo' 42 | let g:gitgutter_close_preview_on_escape = 1 43 | let g:gitgutter_use_location_list = 0 44 | 45 | let g:gitgutter_terminal_reports_focus = 1 46 | 47 | "function! GitStatus() 48 | " let [a,m,r] = GitGutterGetHunkSummary() 49 | " return printf('+%d ~%d -%d', a, m, r) 50 | "endfunction 51 | "set statusline+=%{GitStatus()} 52 | 53 | " Custom variable {{{ 54 | let g:gitgutter_max_acceptable_line = 10000 55 | let g:gitgutter_max_acceptable_column = 10000 56 | let g:gitgutter_max_acceptable_size = 1024 * 1024 " 单位为 byte, 该处表示 1 MB 57 | " }}} 58 | -------------------------------------------------------------------------------- /autoload/hl/fzf.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " https://github.com/junegunn/fzf/blob/master/README-VIM.md 7 | " https://github.com/junegunn/fzf/wiki/Examples-(vim)#delete-buffers-from-buffers 8 | 9 | " Global options supported by fzf#wrap 10 | 11 | " - g:fzf_layout 12 | " - g:fzf_action 13 | " Works only when no custom sink (or sinklist) is provided 14 | " Having custom sink usually means that each entry is not an ordinary file path (e.g. name of color scheme), so we can't blindly apply the same 15 | " strategy (i.e. tabedit some-color-scheme doesn't make sense) 16 | " - g:fzf_colors 17 | " - g:fzf_history_dir 18 | 19 | " 20 | " Search all content use ag{{{ 21 | " query_pattern: 搜索 pattern 22 | " ag_arg: ag 搜索参数 23 | function! hl#fzf#ag_all(query_pattern, ag_arg, ...) 24 | let query_pattern = empty(a:query_pattern) ? '^(?=.)' : a:query_pattern 25 | " ag options 26 | " --hidden: search hidden files,(obeys .*ignore files) 27 | " -u: Search all files (ignore .ignore, .gitignore, etc.; searches binary and hidden files as well) 28 | return fzf#vim#ag_raw(a:ag_arg . ' ' . fzf#shellescape(query_pattern) . ' ' . getcwd()) 29 | endfunction 30 | "}}} 31 | 32 | " Search pattern across repository files{{{ 33 | function! hl#fzf#explore_current(...) 34 | let inpath = substitute(a:1, "'", '', 'g') 35 | if inpath == "" || matchend(inpath, '/') == strlen(inpath) 36 | execute "cd" getcwd() . '/' . inpath 37 | let cwpath = getcwd() . '/' 38 | call fzf#run(fzf#wrap(fzf#vim#with_preview({'source': 'ls -1ap', 'dir': cwpath, 'sink': 'FZFExplore', 'options': ['--prompt', cwpath]}))) 39 | else 40 | let file = getcwd() . '/' . inpath 41 | execute "e" file 42 | endif 43 | endfunction 44 | "}}} 45 | 46 | function! hl#fzf#statusline_theme() 47 | " Override statusline as you like 48 | highlight fzf1 ctermfg=161 ctermbg=251 49 | highlight fzf2 ctermfg=23 ctermbg=251 50 | highlight fzf3 ctermfg=237 ctermbg=251 51 | setlocal statusline=%#fzf1#\ >\ %#fzf2#fz%#fzf3#f 52 | endfunction 53 | 54 | 55 | -------------------------------------------------------------------------------- /autoload/onedark.vim: -------------------------------------------------------------------------------- 1 | " [onedark.vim](https://github.com/joshdick/onedark.vim/) 2 | 3 | let s:overrides = get(g:, "onedark_color_overrides", {}) 4 | 5 | let s:colors = { 6 | \ "red": get(s:overrides, "red", { "gui": "#E06C75", "cterm": "204", "cterm16": "1" }), 7 | \ "dark_red": get(s:overrides, "dark_red", { "gui": "#BE5046", "cterm": "196", "cterm16": "9" }), 8 | \ "green": get(s:overrides, "green", { "gui": "#98C379", "cterm": "114", "cterm16": "2" }), 9 | \ "yellow": get(s:overrides, "yellow", { "gui": "#E5C07B", "cterm": "180", "cterm16": "3" }), 10 | \ "dark_yellow": get(s:overrides, "dark_yellow", { "gui": "#D19A66", "cterm": "173", "cterm16": "11" }), 11 | \ "blue": get(s:overrides, "blue", { "gui": "#61AFEF", "cterm": "39", "cterm16": "4" }), 12 | \ "purple": get(s:overrides, "purple", { "gui": "#C678DD", "cterm": "170", "cterm16": "5" }), 13 | \ "cyan": get(s:overrides, "cyan", { "gui": "#56B6C2", "cterm": "38", "cterm16": "6" }), 14 | \ "white": get(s:overrides, "white", { "gui": "#ABB2BF", "cterm": "145", "cterm16": "15" }), 15 | \ "black": get(s:overrides, "black", { "gui": "#282C34", "cterm": "235", "cterm16": "0" }), 16 | \ "foreground": get(s:overrides, "foreground", { "gui": "#ABB2BF", "cterm": "145", "cterm16": "NONE" }), 17 | \ "background": get(s:overrides, "background", { "gui": "#282C34", "cterm": "235", "cterm16": "NONE" }), 18 | \ "comment_grey": get(s:overrides, "comment_grey", { "gui": "#5C6370", "cterm": "59", "cterm16": "7" }), 19 | \ "gutter_fg_grey": get(s:overrides, "gutter_fg_grey", { "gui": "#4B5263", "cterm": "238", "cterm16": "8" }), 20 | \ "cursor_grey": get(s:overrides, "cursor_grey", { "gui": "#2C323C", "cterm": "236", "cterm16": "0" }), 21 | \ "visual_grey": get(s:overrides, "visual_grey", { "gui": "#3E4452", "cterm": "237", "cterm16": "8" }), 22 | \ "menu_grey": get(s:overrides, "menu_grey", { "gui": "#3E4452", "cterm": "237", "cterm16": "7" }), 23 | \ "special_grey": get(s:overrides, "special_grey", { "gui": "#3B4048", "cterm": "238", "cterm16": "7" }), 24 | \ "vertsplit": get(s:overrides, "vertsplit", { "gui": "#3E4452", "cterm": "59", "cterm16": "7" }), 25 | \} 26 | 27 | function! onedark#GetColors() 28 | return s:colors 29 | endfunction 30 | -------------------------------------------------------------------------------- /plugin/coc.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " Configuration file located at ~/.vim/coc-settings.json 7 | 8 | if !hl#plug_loaded('coc.nvim') 9 | finish 10 | endif 11 | 12 | " inoremap 13 | " \ coc#expandableOrJumpable() ? "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : 14 | " \ check_back_space() ? "\" : 15 | " \ coc#refresh() 16 | " " \ pumvisible() ? coc#_select_confirm() : "help select first complete when there's no selected. 17 | 18 | " function! s:check_back_space() abort 19 | " let col = col('.') - 1 20 | " return !col || getline('.')[col - 1] =~# '\s' 21 | " endfunction 22 | 23 | let g:coc_snippet_next = '' 24 | let g:coc_snippet_prev = '' 25 | let g:coc_global_extensions = [ 26 | \ 'coc-clangd', 27 | \ 'coc-cmake', 28 | \ 'coc-css', 29 | \ 'coc-db', 30 | \ 'coc-lists', 31 | \ 'coc-diagnostic', 32 | \ 'coc-dictionary', 33 | \ 'coc-emoji', 34 | \ 'coc-flutter', 35 | \ 'coc-gitignore', 36 | \ 'coc-go', 37 | \ 'coc-highlight', 38 | \ 'coc-html', 39 | \ 'coc-xml', 40 | \ 'coc-java', 41 | \ 'coc-json', 42 | \ 'coc-julia', 43 | \ 'coc-lua', 44 | \ 'coc-markdownlint', 45 | \ 'coc-omni', 46 | \ 'coc-pyright', 47 | \ 'coc-r-lsp', 48 | \ 'coc-rome', 49 | \ 'coc-rust-analyzer', 50 | \ 'coc-snippets', 51 | \ 'coc-solargraph', 52 | \ 'coc-sourcekit', 53 | \ 'coc-syntax', 54 | \ 'coc-tag', 55 | \ 'coc-tsserver', 56 | \ 'coc-vetur', 57 | \ 'coc-vimlsp', 58 | \ 'coc-word', 59 | \ 'coc-yaml', 60 | \ 'coc-ci', 61 | \ '@yaegassy/coc-marksman', 62 | \ ] 63 | " \ 'coc-yank', 64 | 65 | let g:coc_disable_file_types = [ 66 | \'log', 67 | \] 68 | let g:coc_disbale_file_patterns = ['Rime/.\{-}.dict.yaml$', '.zsh_history'] 69 | let g:coc_max_acceptable_line = 10000 70 | let g:coc_max_acceptable_column = 10000 71 | let g:coc_max_acceptable_size = 1024 * 1024 " 单位为 byte, 该处表示 1 MB 72 | -------------------------------------------------------------------------------- /plugin/ale.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('ale') 7 | finish 8 | endif 9 | 10 | let g:ale_enabled = 1 11 | let b:ale_fixers = ['prettier', 'eslint'] 12 | let g:ale_fixers = { 13 | \ '*': ['remove_trailing_lines','trim_whitespace' ], 14 | \ 'python': ['autopep8'] 15 | \} 16 | let g:ale_set_highlights = 0 17 | "let g:ale_fix_on_save = 1 "auto Sava 18 | let g:ale_echo_cursor = 1 19 | let g:ale_echo_msg_error_str = '' 20 | let g:ale_echo_msg_warning_str = '' 21 | let g:ale_echo_msg_format = '[#%linter%#] %s [%severity%]' 22 | let g:ale_echo_delay = 20 23 | let g:ale_set_balloons = 1 24 | let g:ale_hover_cursor = 0 25 | let g:ale_sign_column_always = 1 "始终开启标志列 26 | let g:ale_sign_error = '•' 27 | let g:ale_sign_warning = '•' 28 | let g:ale_cursor_detail = 0 " 移动到当前行的时候会在底部预览窗口(比较大, 会改变窗口布局)内显示详细信息 29 | let g:ale_completion_enabled = 0 30 | let g:ale_lint_delay = 500 31 | let g:ale_linters_explicit = 1 32 | let g:ale_lint_on_text_changed = 'normal' 33 | let g:ale_lint_on_insert_leave = 1 34 | let g:airline#extensions#ale#enabled = 0 35 | let g:ale_list_window_size = 5 36 | let g:ale_statusline_format = ['E•%d', 'W•%d', 'OK'] 37 | let g:ale_virtualtext_cursor = 0 38 | 39 | let g:ale_linters = { 40 | \ 'c': ['clangd'], 41 | \ 'cpp': ['clangd'], 42 | \ 'swift': ['swiftlint'], 43 | \ 'markdown': ['markdownlint'], 44 | \ 'python': ['pylint'], 45 | \ 'vim': ['vint'], 46 | \ 'json': ['jsonlint'], 47 | \ 'sh': ['shellcheck'], 48 | \ 'zsh': ['shellcheck'], 49 | \ 'yaml': ['yamllint'] 50 | \} 51 | 52 | let g:ale_fixers = { 53 | \ 'swift': ['swiftformat'] 54 | \} 55 | let g:ale_c_clangd_executable = $HOMEBREW_PREFIX.'/opt/llvm/bin/clangd' 56 | let g:ale_cpp_clangd_executable = $HOMEBREW_PREFIX.'/opt/llvm/bin/clangd' 57 | " let g:ale_cpp_clangd_options = '-std=c++18' 58 | " let g:ale_cpp_clangd_options = '' "不能使用 $CFLAGS, 这个是 clangd 的命令选项 59 | " let g:ale_c_gcc_options = '-Wall -O2 -std=c99 -I/usr/local/Cellar/glib/2.66.7/include/glib-2.0' 60 | " let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++14' 61 | " let g:ale_c_cppcheck_options = '' 62 | " let g:ale_cpp_cppcheck_options = '' 63 | 64 | let g:ale_markdown_markdownlint_options='-c $HOME/.markdownlint.json' 65 | -------------------------------------------------------------------------------- /autoload/hl/format.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " general format 7 | function! hl#format#general() range 8 | let range = a:firstline . ',' . a:lastline 9 | if &filetype ==? 'markdown' 10 | execute range . "FormatMarkdown" 11 | elseif &filetype ==? 'vim' || &filetype ==? 'jsonc' || &filetype ==? 'json5' 12 | call hl#format#reindent_document(a:firstline, a:lastline) 13 | elseif &filetype ==? 'csv' 14 | execute range . "ArrangeColumn!" 15 | else 16 | execute range . "Autoformat" 17 | endif 18 | endfunction 19 | 20 | function! hl#format#reindent_document(startline, endline) 21 | execute a:startline . ',' . a:endline . 'normal! ==' 22 | " keepjumps normal! gg=G 23 | endfunction 24 | 25 | function! hl#format#cn() range 26 | let regex_list = [] 27 | let regex_list = add(regex_list, '/,/, /g') 28 | let regex_list = add(regex_list, '/。/. /g') 29 | let regex_list = add(regex_list, '/:/: /g') 30 | let regex_list = add(regex_list, '/?/? /g') 31 | let regex_list = add(regex_list, '/;/; /g') 32 | let regex_list = add(regex_list, '/“\|”/"/g') 33 | let regex_list = add(regex_list, "/‘\\|’/'/g") " => /‘\|’/'/g 34 | let regex_list = add(regex_list, '/、/, /g') 35 | let regex_list = add(regex_list, '/(/(/g') 36 | let regex_list = add(regex_list, '/)/)/g') 37 | let regex_list = add(regex_list, '/!/!/g') 38 | let regex_list = add(regex_list, '/「/ **/g') 39 | let regex_list = add(regex_list, '/」/** /g') 40 | 41 | " 汉字在前, 英文/数字在后, 中间添加空格 42 | " let regex_list = add(regex_list, '/\([\u4e00-\u9fff\u3040-\u30FF]\)\([a-zA-Z0-9@&=\[\$\%\^\-\+(\/\\]\)/\1 \2/g') 43 | let regex_list = add(regex_list, '/\([\u4e00-\u9fff\u3040-\u30FF]\)\([a-zA-Z0-9@&=\[\$\%\^\-\+\/\\]\)/\1 \2/g') 44 | 45 | " 英文/数字在前, 汉字在后, 中间添加空格 46 | " let regex_list = add(regex_list, '/\([a-zA-Z0-9!&;=\]\,\.\?\$\%\^\-\+\)\/\\]\)\([\u4e00-\u9fff\u3040-\u30FF]\)/\1 \2/g') 47 | let regex_list = add(regex_list, '/\([a-zA-Z0-9!&;=\]\,\.\?\$\%\^\-\+\\]\)\([\u4e00-\u9fff\u3040-\u30FF]\)/\1 \2/g') 48 | 49 | for pattern in regex_list 50 | execute a:firstline . "," . a:lastline . " substitute " . pattern 51 | endfor 52 | endfunction 53 | 54 | "{{{ 55 | function! hl#format#objectmapper() 56 | retab! 57 | %s /\/\/.*\n//ge 58 | %s /^.* \(.*\):.*/ \1 <- map["\1"]/ge 59 | endfunction 60 | "}}} 61 | -------------------------------------------------------------------------------- /after/ftplugin/rst.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | let b:table_mode_corner='+' "设置转角处为 `|`, 如果设为其他比如`+`, Markdown 语法不支持 7 | let b:table_mode_corner_corner='+' 8 | let b:table_mode_header_fillchar='=' 9 | 10 | setlocal synmaxcol=0 " Text after this column number is not highlighted 11 | setlocal textwidth=0 12 | " setlocal conceallevel=2 13 | setlocal conceallevel=0 14 | setlocal concealcursor="" 15 | setlocal formatoptions+=o2mbB1 16 | 17 | " undo break points 18 | inoremap , ,u 19 | inoremap . .u 20 | inoremap : :u 21 | inoremap ; ;u 22 | inoremap ! !u 23 | inoremap ? ?u 24 | 25 | " jumplist mutations 26 | nnoremap k (v:count > 5 ? "m'" . v:count : "") . 'gk' 27 | nnoremap j (v:count > 5 ? "m'" . v:count : "") . 'gj' 28 | 29 | noremap gj j 30 | noremap gk k 31 | 32 | func! s:section_delimiter_adjust() abort 33 | let section_delim = '^\([=`:."' . "'" . '~^_*+#-]\)\1*$' 34 | let cline = getline('.') 35 | if cline =~ '^\s*$' | return | endif 36 | if cline !~ section_delim && cline !~ '^\s\+\S' 37 | let nline = getline(line('.') + 1) 38 | let pline = getline(line('.') - 1) 39 | if pline =~ '^\s*$' && nline =~ section_delim 40 | call setline(line('.') + 1, repeat(nline[0], strwidth(cline))) 41 | elseif pline =~ section_delim && nline =~ section_delim && pline[0] == nline[0] 42 | call setline(line('.') + 1, repeat(nline[0], strwidth(cline))) 43 | call setline(line('.') - 1, repeat(pline[0], strwidth(cline))) 44 | endif 45 | endif 46 | endfunc 47 | 48 | augroup rst_section 49 | au! 50 | au InsertLeave :call s:section_delimiter_adjust() 51 | augroup END 52 | 53 | func! s:rst_view() abort 54 | let output = tempname() . '.html' 55 | 56 | call system(printf("%s %s %s %s", 57 | \ "rst2html5", 58 | \ " --input-encoding=utf8 --stylesheet-path=minimal.css,responsive.css", 59 | \ shellescape(expand("%:p")), 60 | \ output 61 | \ )) 62 | 63 | " Comment/Uncomment what is appropriate 64 | " OSX 65 | exe ':silent !open ' . output 66 | " Windows 67 | " exe ':silent !start ' . output 68 | " Linux 69 | " exe ':silent !xdg-open ' . output 70 | endfunc 71 | 72 | command! -buffer RSTView call s:rst_view() 73 | -------------------------------------------------------------------------------- /plugin/fzf.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('fzf.vim') 7 | finish 8 | endif 9 | 10 | " let g:fzf_preview_window = 'right:60%' 11 | let g:fzf_buffers_jump = 1 " [Buffers] Jump to the existing window if possible 12 | let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"' " [[B]Commits] Customize the options used by 'git log' 13 | let g:fzf_files_options = '--preview "rougify {2..} | head -'.&lines.'"' 14 | let g:fzf_tags_command = 'ctags -R' " [Tags] Command to generate tags file 15 | let g:fzf_commands_expect = 'alt-enter,ctrl-x' " [Commands] --expect expression for directly executing the command 16 | let g:fzf_preview_window = ['right:50%:hidden:nowrap', '?'] 17 | " Empty value to disable preview window altogether 18 | " let g:fzf_preview_window = [] 19 | 20 | " `g:fzf_action`, `g:fzf_layout`, `g:fzf_colors`, `g:fzf_history_dir` will be used in `fzf#wrap()` 21 | let g:fzf_action = { 22 | \ 'ctrl-t': 'tab split', 23 | \ 'ctrl-x': 'split', 24 | \ 'ctrl-v': 'vsplit', 25 | \ 'ctrl-s': 'FzfFilesWithFilePath', 26 | \ 'alt-bs': 'FzfPreLevel', 27 | \} 28 | 29 | 30 | func s:enter_file_root(file) 31 | " call fzf#run(fzf#wrap('ls', {'source': 'ls', 'dir': '/Users/hanley/.vim'})) 32 | let dir = fnamemodify(a:file, ':p:h') 33 | call fzf#vim#files(dir, fzf#vim#with_preview()) 34 | endfunction 35 | 36 | if has('popupwin') || has('nvim') 37 | " let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.8, 'relative': v:true } } 38 | let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.8 } } 39 | else 40 | let g:fzf_layout = { 'down': '~60%' } 41 | endif 42 | " let g:fzf_colors = 43 | " \ { 44 | " \ 'fg': ['fg', 'Normal'], 45 | " \ 'bg': ['bg', 'Normal'], 46 | " \ 'hl': ['fg', 'Comment'], 47 | " \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], 48 | " \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], 49 | " \ 'hl+': ['fg', 'Statement'], 50 | " \ 'info': ['fg', 'PreProc'], 51 | " \ 'border': ['fg', 'Ignore'], 52 | " \ 'prompt': ['fg', 'Conditional'], 53 | " \ 'pointer': ['fg', 'Exception'], 54 | " \ 'marker': ['fg', 'Keyword'], 55 | " \ 'spinner': ['fg', 'Label'], 56 | " \ 'header': ['fg', 'Comment'] 57 | " \ } 58 | " let g:fzf_history_dir = '~/.local/share/fzf-history' " 使用之后 c-n, c-p 就是前后命令的意思, 不好 59 | 60 | -------------------------------------------------------------------------------- /autoload/hl/chezmoi.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | function! s:get_target_file(original_abs_path) 7 | let fixed_name = s:get_fixed_name(fnamemodify(a:original_abs_path, ':t')) 8 | 9 | if empty(fixed_name) 10 | return 11 | endif 12 | 13 | let until_dot_prefix = s:get_fixed_dir(a:original_abs_path) . '/' . fixed_name 14 | let until_literal_prefix = substitute(until_dot_prefix, '\C/\zsdot_', '.', 'g') 15 | let b:chezmoi_target_path = substitute(until_literal_prefix, '\C/\zsliteral_', '', 'g') " ~/.local/share/chezmoi/.zshrc 16 | let b:final_target_path = substitute(b:chezmoi_target_path, '.local/share/chezmoi/', '', 'g') " ~/.zshrc 17 | 18 | return b:final_target_path 19 | endfunction 20 | 21 | function! s:get_fixed_name(original_name) abort 22 | if !exists('s:name_prefix_pattern') 23 | let s:name_prefix_pattern = s:get_name_prefix_pattern() 24 | endif 25 | 26 | return substitute(a:original_name, '\C\v^' . s:name_prefix_pattern . '|%(\.literal)?%(\.tmpl)?$', '', 'g') 27 | endfunction 28 | 29 | function! s:get_name_prefix_pattern() 30 | let prefix_list = [ 31 | \ 'create', 32 | \ 'modify', 33 | \ 'remove', 34 | \ 'run', 35 | \ 'encrypted', 36 | \ 'private', 37 | \ 'readonly', 38 | \ 'executable', 39 | \ 'once', 40 | \ 'onchange', 41 | \ 'before', 42 | \ 'after', 43 | \ 'symlink', 44 | \ 'empty' 45 | \ ] 46 | return join(map(prefix_list, '"%(" . v:val . "_)?"'), '') 47 | endfunction 48 | 49 | function! s:get_fixed_dir(original_abs_path) abort 50 | return substitute(fnamemodify(a:original_abs_path, ':h'), '\C\v/\zs%(exact_)?%(private_)?%(readonly_)?\ze%(literal_)?', '', 'g') 51 | endfunction 52 | 53 | " Swap between target path and source path 54 | function! hl#chezmoi#swap_between_target_and_source() 55 | let current_path = expand('%:p') 56 | if current_path =~# '.local/share/chezmoi/' " current path is located in ~/.local/share/chezmoi/, now we are inside the source path 57 | let target_path = s:get_target_file(current_path) 58 | exec 'edit ' . target_path 59 | else " now we are in the target path, so we should check this file have corresponding source file or not 60 | let target_path = system('chezmoi source-path ' . current_path) 61 | if v:shell_error != 0 62 | echoerr 'Current file is not managed by chezmoi!!!' 63 | else 64 | exec 'edit ' . target_path 65 | endif 66 | endif 67 | endfunction 68 | -------------------------------------------------------------------------------- /autoload/lightline/colorscheme/gruvbox.vim: -------------------------------------------------------------------------------- 1 | " ----------------------------------------------------------------------------- 2 | " File: gruvbox.vim 3 | " Description: Gruvbox colorscheme for Lightline (itchyny/lightline.vim) 4 | " Author: gmoe 5 | " Source: https://github.com/morhetz/gruvbox 6 | " Last Modified: 20 Sep 2017 7 | " ----------------------------------------------------------------------------- 8 | 9 | function! s:getGruvColor(group) 10 | let guiColor = synIDattr(hlID(a:group), "fg", "gui") 11 | let termColor = synIDattr(hlID(a:group), "fg", "cterm") 12 | return [ guiColor, termColor ] 13 | endfunction 14 | 15 | if exists('g:lightline') 16 | 17 | let s:bg0 = s:getGruvColor('GruvboxBg0') 18 | let s:bg1 = s:getGruvColor('GruvboxBg1') 19 | let s:bg2 = s:getGruvColor('GruvboxBg2') 20 | let s:bg4 = s:getGruvColor('GruvboxBg4') 21 | let s:fg1 = s:getGruvColor('GruvboxFg1') 22 | let s:fg4 = s:getGruvColor('GruvboxFg4') 23 | 24 | let s:yellow = s:getGruvColor('GruvboxYellow') 25 | let s:blue = s:getGruvColor('GruvboxBlue') 26 | let s:aqua = s:getGruvColor('GruvboxAqua') 27 | let s:orange = s:getGruvColor('GruvboxOrange') 28 | let s:green = s:getGruvColor('GruvboxGreen') 29 | 30 | let s:p = {'normal':{}, 'inactive':{}, 'insert':{}, 'replace':{}, 'visual':{}, 'tabline':{}, 'terminal':{}} 31 | let s:p.normal.left = [ [ s:bg0, s:fg4, 'bold' ], [ s:fg4, s:bg2 ] ] 32 | let s:p.normal.right = [ [ s:bg0, s:fg4 ], [ s:fg4, s:bg2 ] ] 33 | let s:p.normal.middle = [ [ s:fg4, s:bg1 ] ] 34 | let s:p.inactive.right = [ [ s:bg4, s:bg1 ], [ s:bg4, s:bg1 ] ] 35 | let s:p.inactive.left = [ [ s:bg4, s:bg1 ], [ s:bg4, s:bg1 ] ] 36 | let s:p.inactive.middle = [ [ s:bg4, s:bg1 ] ] 37 | let s:p.insert.left = [ [ s:bg0, s:blue, 'bold' ], [ s:fg1, s:bg2 ] ] 38 | let s:p.insert.right = [ [ s:bg0, s:blue ], [ s:fg1, s:bg2 ] ] 39 | let s:p.insert.middle = [ [ s:fg4, s:bg2 ] ] 40 | let s:p.terminal.left = [ [ s:bg0, s:green, 'bold' ], [ s:fg1, s:bg2 ] ] 41 | let s:p.terminal.right = [ [ s:bg0, s:green ], [ s:fg1, s:bg2 ] ] 42 | let s:p.terminal.middle = [ [ s:fg4, s:bg2 ] ] 43 | let s:p.replace.left = [ [ s:bg0, s:aqua, 'bold' ], [ s:fg1, s:bg2 ] ] 44 | let s:p.replace.right = [ [ s:bg0, s:aqua ], [ s:fg1, s:bg2 ] ] 45 | let s:p.replace.middle = [ [ s:fg4, s:bg2 ] ] 46 | let s:p.visual.left = [ [ s:bg0, s:orange, 'bold' ], [ s:bg0, s:bg4 ] ] 47 | let s:p.visual.right = [ [ s:bg0, s:orange ], [ s:bg0, s:bg4 ] ] 48 | let s:p.visual.middle = [ [ s:fg4, s:bg1 ] ] 49 | let s:p.tabline.left = [ [ s:fg4, s:bg2 ] ] 50 | let s:p.tabline.tabsel = [ [ s:bg0, s:fg4 ] ] 51 | let s:p.tabline.middle = [ [ s:bg0, s:bg0 ] ] 52 | let s:p.tabline.right = [ [ s:bg0, s:orange ] ] 53 | let s:p.normal.error = [ [ s:bg0, s:orange ] ] 54 | let s:p.normal.warning = [ [ s:bg2, s:yellow ] ] 55 | 56 | let g:lightline#colorscheme#gruvbox#palette = lightline#colorscheme#flatten(s:p) 57 | endif 58 | -------------------------------------------------------------------------------- /plugin/startify.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-startify') 7 | finish 8 | endif 9 | 10 | "" 设置书签 11 | let g:startify_bookmarks = [ 12 | \ '~/.vimrc', 13 | \] 14 | let g:startify_files_number = 10 "起始页显示的列表长度 15 | let g:startify_session_autoload = 1 "是否自动加载目录下的Session.vim, 很好用 16 | let g:startify_change_to_dir = 0 17 | let g:startify_change_to_vcs_root = 0 18 | "过滤列表, 支持正则表达式 19 | let g:startify_skiplist = [ 20 | \ '\.vimgolf', 21 | \ '^/tmp', 22 | \ '/project/.*/documentation', 23 | \ ] 24 | "页眉区域显示 25 | let g:startify_custom_header = [ 26 | \ ' __ __ __ __ ', 27 | \ ' / / / /____ _ ____ / /___ __ __ / / ___ ___ ', 28 | \ ' / /_/ // __ `// __ \ / // _ \ / / / / / / / _ \ / _ \ ', 29 | \ ' / __ // /_/ // / / // // __// /_/ / / /___/ __// __/ ', 30 | \ ' /_/ /_/ \__,_//_/ /_//_/ \___/ \__, / /_____/\___/ \___/ ', 31 | \ ' /____/ ', 32 | \] 33 | "页脚区域显示 34 | let g:startify_custom_footer = [ 35 | \ ' +-------------------------------------------------------+', 36 | \ ' | DONE: Swift Shell C/C++ OC Python JavaScript VimL |', 37 | \ ' +-------------------------------------------------------+', 38 | \ ' ', 39 | \ ' +-------------------------------------------------------+', 40 | \ ' | TODO: Dart Lua ZSH Rust Go Java |', 41 | \ ' +-------------------------------------------------------+', 42 | \] 43 | 44 | " Startify 自动呼叫 45 | function! StartifyEntryFormat() 46 | return 'WebDevIconsGetFileTypeSymbol(absolute_path) ." ". entry_path' 47 | endfunction 48 | 49 | " |g:startify_change_cmd| 50 | " |g:startify_enable_special| 51 | " |g:startify_list_order| 52 | " |g:startify_lists| 53 | let g:startify_update_oldfiles = 1 54 | 55 | " |g:startify_commands| 56 | " |g:startify_custom_header_quotes| 57 | " |g:startify_custom_indices| 58 | " |g:startify_disable_at_vimenter| 59 | " |g:startify_enable_unsafe| 60 | " |g:startify_fortune_use_unicode| 61 | " |g:startify_padding_left| 62 | let g:startify_relative_path = 1 63 | " |g:startify_skiplist_server| 64 | " |g:startify_use_env| 65 | 66 | " |g:startify_session_before_save| 67 | " |g:startify_session_delete_buffers| 68 | let g:startify_session_dir = "~/.cache/vim/session" 69 | " |g:startify_session_number| 70 | let g:startify_session_persistence = 1 71 | " |g:startify_session_remove_lines| 72 | " |g:startify_session_savecmds| 73 | " |g:startify_session_savevars| 74 | " |g:startify_session_sort| 75 | -------------------------------------------------------------------------------- /autoload/hl/fs.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " get path until directory 7 | func! hl#fs#getOnlyDirectory() 8 | " if &filetype ==# 'netrw' 9 | " return getcwd() 10 | " else 11 | return resolve(expand('%:p:h')) 12 | " endif 13 | endfunc 14 | 15 | " get only file name 16 | func! hl#fs#getOnlyFileName() 17 | if &filetype ==# 'netrw' 18 | return '' 19 | else 20 | return resolve(expand('%:t')) 21 | endif 22 | endfunc 23 | 24 | " get full path 25 | func! hl#fs#getFullPathName() 26 | return resolve(expand('%:p')) 27 | endfunction 28 | 29 | func! hl#fs#getDirs(dir) 30 | if empty(a:dir) 31 | let a:dir = hl#fs#getOnlyDirectory() 32 | endif 33 | let expanded_dir = expand(a:dir) 34 | let directories=glob(fnameescape(expanded_dir).'/{,.}*/', 1, 1) 35 | call map(directories, 'fnamemodify(v:val, ":p:h")') 36 | return directories 37 | endfunction 38 | 39 | function! hl#fs#resolveFilePath(relative_path) 40 | " 1. Expand environment variables in the path 41 | let expanded_path = expand(a:relative_path) 42 | 43 | " 2. Check if the expanded path is an absolute path 44 | if !empty(expanded_path) && (expanded_path[0] ==# '/' || expanded_path[0] ==# '\\') 45 | return fnamemodify(expanded_path, ':p') " Return the absolute path directly 46 | endif 47 | 48 | " 3. Resolve relative to the current file's directory 49 | let current_file_dir = fnamemodify(expand('%:p:h'), ':p') 50 | let candidate1 = fnamemodify(current_file_dir . '/' . expanded_path, ':p') 51 | if filereadable(candidate1) 52 | return candidate1 53 | endif 54 | 55 | " 4. Resolve relative to the current working directory 56 | let candidate2 = fnamemodify(expanded_path, ':p') 57 | if filereadable(candidate2) 58 | return candidate2 59 | endif 60 | 61 | " 5. Search in the directories specified by the 'path' option 62 | for dir in split(&path, ',') 63 | if dir ==# '.' 64 | let dir = current_file_dir 65 | elseif dir ==# '' 66 | continue 67 | endif 68 | 69 | " Handle "**" for recursive search 70 | if dir =~ '\*\*' 71 | let glob_pattern = fnamemodify(dir, ':h') . '/**/' . expanded_path 72 | let matches = glob(glob_pattern, 0, 1) " Find recursively 73 | if !empty(matches) 74 | return matches[0] " Return the first match 75 | endif 76 | else 77 | let candidate3 = fnamemodify(dir . '/' . expanded_path, ':p') 78 | if filereadable(candidate3) 79 | return candidate3 80 | endif 81 | endif 82 | endfor 83 | 84 | echom 'no file found in resolveFilePath' 85 | " 6. If not found, return the unresolved path with an error 86 | return '' 87 | endfunction 88 | -------------------------------------------------------------------------------- /autoload/hl/onedark.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | let s:colors = onedark#GetColors() 7 | 8 | let s:red = s:colors.red 9 | let s:dark_red = s:colors.dark_red 10 | let s:green = s:colors.green 11 | let s:yellow = s:colors.yellow 12 | let s:dark_yellow = s:colors.dark_yellow 13 | let s:blue = s:colors.blue 14 | let s:purple = s:colors.purple 15 | let s:cyan = s:colors.cyan 16 | let s:white = s:colors.white 17 | let s:black = s:colors.black 18 | let s:foreground = s:colors.foreground 19 | let s:background = s:colors.background 20 | let s:comment_grey = s:colors.comment_grey 21 | let s:gutter_fg_grey = s:colors.gutter_fg_grey 22 | let s:cursor_grey = s:colors.cursor_grey 23 | let s:visual_grey = s:colors.visual_grey 24 | let s:menu_grey = s:colors.menu_grey 25 | let s:special_grey = s:colors.special_grey 26 | let s:vertsplit = s:colors.vertsplit 27 | let s:orange = { "gui": "#FF8700", "cterm": "208", "cterm16": "11" } 28 | 29 | let s:reverse = 'reverse' " reverse 会让主题色的优先级更高, 如果遇到颜色优先级问题, 可以尝试使用 reverse 解决(灵感来自 gruvbox) 30 | let s:bold = 'bold' 31 | let s:reverse_bold = 'reverse,bold' 32 | let s:underline = 'underline' 33 | let s:italic = 'italic' 34 | let s:strikethrough = 'strikethrough' 35 | 36 | function! hl#onedark#patch() 37 | call onedark#set_highlight('pythonBuiltinFunc', {'fg': s:cyan}) 38 | call onedark#set_highlight('Search', {'fg': s:yellow, 'bg': s:black, 'gui': s:reverse_bold, 'cterm': s:reverse_bold}) 39 | call onedark#set_highlight('Todo', {'fg': s:orange, 'gui': s:bold, 'cterm': s:bold}) 40 | call onedark#set_highlight('Error', {'fg': s:red, 'bg': s:black, 'gui': s:reverse_bold, 'cterm': s:reverse_bold}) 41 | call onedark#set_highlight('HLNote', {'fg': s:blue, 'gui': s:bold, 'cterm': s:bold}) 42 | call onedark#set_highlight('HLWarning', {'fg': s:orange, 'gui': s:bold, 'cterm': s:bold}) 43 | call onedark#set_highlight('HLError', {'fg': s:red, 'gui': s:bold, 'cterm': s:bold}) 44 | 45 | " coc.nvim {{{ 46 | if hl#plug_loaded('coc.nvim') 47 | call onedark#set_highlight('CocHighlightText', {'bg': s:vertsplit, 'gui': s:bold, 'cterm': s:bold}) 48 | call onedark#set_highlight('HighlightedyankRegion', {'fg': s:black, 'bg': s:green, 'gui': s:bold, 'cterm': s:bold}) 49 | call onedark#set_highlight('CocFloating', {'fg': s:white, 'bg': s:visual_grey}) 50 | call onedark#set_highlight('CocMenuSel', {'fg': s:black, 'bg': s:blue, 'gui': s:bold, 'cterm': s:bold}) 51 | call onedark#set_highlight('CocPumSearch', {'fg': s:green}) 52 | call onedark#set_highlight('CocListLine', {'bg': s:background, 'gui': s:bold, 'cterm': s:bold}) 53 | call onedark#set_highlight('CocListSearch', {'fg': s:green}) 54 | call onedark#set_highlight('CocInlayHint', {'fg': s:comment_grey, 'gui': s:italic, 'cterm': s:italic}) 55 | endif 56 | "}}} 57 | 58 | " highlight Todo ctermbg=208 ctermfg=black gui=bold guibg=#ff8700 guifg=black 59 | endfunction 60 | -------------------------------------------------------------------------------- /autoload/lightline/colorscheme/onedark.vim: -------------------------------------------------------------------------------- 1 | " [onedark.vim](https://github.com/joshdick/onedark.vim/) 2 | 3 | " This is a [lightline.vim](https://github.com/itchyny/lightline.vim) colorscheme for use with 4 | " the [onedark.vim](https://github.com/joshdick/onedark.vim) colorscheme. 5 | 6 | let s:colors = onedark#GetColors() 7 | 8 | if get(g:, 'onedark_termcolors', 256) == 16 9 | let s:term_red = s:colors.red.cterm16 10 | let s:term_green = s:colors.green.cterm16 11 | let s:term_yellow = s:colors.yellow.cterm16 12 | let s:term_blue = s:colors.blue.cterm16 13 | let s:term_purple = s:colors.purple.cterm16 14 | let s:term_white = s:colors.white.cterm16 15 | let s:term_cursor_grey = s:colors.cursor_grey.cterm16 16 | let s:term_visual_grey = s:colors.visual_grey.cterm16 17 | else 18 | let s:term_red = s:colors.red.cterm 19 | let s:term_green = s:colors.green.cterm 20 | let s:term_yellow = s:colors.yellow.cterm 21 | let s:term_blue = s:colors.blue.cterm 22 | let s:term_purple = s:colors.purple.cterm 23 | let s:term_white = s:colors.white.cterm 24 | let s:term_cursor_grey = s:colors.cursor_grey.cterm 25 | let s:term_visual_grey = s:colors.visual_grey.cterm 26 | endif 27 | 28 | let s:red = [ s:colors.red.gui, s:term_red ] 29 | let s:green = [ s:colors.green.gui, s:term_green ] 30 | let s:yellow = [ s:colors.yellow.gui, s:term_yellow ] 31 | let s:blue = [ s:colors.blue.gui, s:term_blue ] 32 | let s:purple = [ s:colors.purple.gui, s:term_purple ] 33 | let s:white = [ s:colors.white.gui, s:term_white ] 34 | let s:cursor_grey = [ s:colors.cursor_grey.gui, s:term_cursor_grey ] 35 | let s:visual_grey = [ s:colors.visual_grey.gui, s:term_visual_grey ] 36 | 37 | let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}} 38 | let s:p.normal.left = [ [ s:cursor_grey, s:green ], [ s:white, s:visual_grey ] ] 39 | let s:p.normal.right = [ [ s:cursor_grey, s:green ], [ s:white, s:visual_grey ] ] 40 | let s:p.inactive.left = [ [ s:white, s:visual_grey ], [ s:white, s:visual_grey ] ] 41 | let s:p.inactive.right = [ [ s:cursor_grey, s:white ], [ s:cursor_grey, s:white ] ] 42 | let s:p.insert.left = [ [ s:cursor_grey, s:blue ], [ s:white, s:visual_grey ] ] 43 | let s:p.insert.right = [ [ s:cursor_grey, s:blue ], [ s:white, s:visual_grey ] ] 44 | let s:p.replace.left = [ [ s:cursor_grey, s:red ], [ s:white, s:visual_grey ] ] 45 | let s:p.replace.right = [ [ s:cursor_grey, s:red ], [ s:white, s:visual_grey ] ] 46 | let s:p.visual.left = [ [ s:cursor_grey, s:purple ], [ s:white, s:visual_grey ] ] 47 | let s:p.visual.right = [ [ s:cursor_grey, s:purple ], [ s:white, s:visual_grey ] ] 48 | let s:p.normal.middle = [ [ s:white, s:cursor_grey ] ] 49 | let s:p.inactive.middle = [ [ s:white, s:visual_grey ] ] 50 | let s:p.tabline.left = [ [ s:white, s:visual_grey ] ] 51 | let s:p.tabline.tabsel = [ [ s:cursor_grey, s:white ] ] 52 | let s:p.tabline.middle = [ [ s:white, s:cursor_grey ] ] 53 | let s:p.tabline.right = [ [ s:white, s:visual_grey ] ] 54 | let s:p.normal.error = [ [ s:cursor_grey, s:red ] ] 55 | let s:p.normal.warning = [ [ s:cursor_grey, s:yellow ] ] 56 | 57 | let g:lightline#colorscheme#onedark#palette = lightline#colorscheme#flatten(s:p) 58 | 59 | -------------------------------------------------------------------------------- /ginit.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | " 6 | if exists('g:loaded_gui_init') 7 | finish 8 | endif 9 | let g:loaded_gui_init = 1 10 | 11 | if g:is_in_macvim_gui " 位于 macvim 的 gui 模式下 12 | 13 | " " Set font size based on screen size. When vertical height is greater than 900 14 | " " (i.e. an external monitor is attached on 13" or smaller MacBooks), use 18, else use 16. 15 | " if has('mac') 16 | " if system("osascript -e 'tell application \"Finder\" to get bounds of window of desktop' | cut -d ' ' -f 4") > 900 17 | " set guifont=Inconsolata:h18 18 | " else 19 | " set guifont=Inconsolata:h16 20 | " endif 21 | " endif 22 | set encoding=utf-8 " MacVim: use UTF-8 everywhere. 23 | set guifont=FiraCode\ Nerd\ Font\ Mono:h15 " 设置 GUI 下字体及大小 24 | " set guifont=Iosevka\ Nerd\ Font:h16 " 设置 GUI 下字体及大小 25 | " set guifontwide=Microsoft\ YaHei:h14 " 设置 GUI 下中文字体及大小 26 | set guifontwide=LXGW\ WenKai\ Mono:h15 " 设置 GUI 下中文字体及大小 27 | set guicursor+=a:blinkon0 " 设置光标不闪动 28 | " set guioptions-=e " When 'e' is missing a non-GUI tab pages line may be used. 29 | set guioptions-=T " MacVim: hide toolbar. 30 | set guioptions-=r " MacVim: hide right scrollbar. 31 | set guioptions-=R " MacVim: hide right scrollbar. 32 | set guioptions-=l " MacVim: hide left scrollbar. 33 | set guioptions-=L " MacVim: hide left scrollbar. 34 | set tabpagemax=100 35 | " set lines=100 36 | " set columns=130 37 | 38 | set toolbariconsize=small 39 | set antialias " MacVim: smooth fonts. 40 | set macmeta " Receive meta key 41 | set blurradius=10 42 | set nofullscreen 43 | set fuoptions=maxvert,maxhorz 44 | " set macligatures 45 | set macthinstrokes 46 | set transparency=0 47 | " 释放 48 | macm File.New\ Tab key= 49 | macm Edit.Font.Bigger key= 50 | macm Edit.Font.Smaller key= 51 | " let macvim_skip_cmd_opt_movement = 1 52 | " " This removes the Cmd-P binding from 'Print': 53 | " macmenu &File.Print key= 54 | endif 55 | 56 | if exists('g:GuiLoaded') " 当前位于 neovim-qt 57 | lang en_US.UTF-8 58 | " Use GuiFont! to ignore font errors 59 | execute 'GuiFont! ' . 'YaHei Fira Icon Hybrid:h16' 60 | 61 | " Disable GUI Tabline 62 | GuiTabline 0 63 | 64 | " Disable GUI Popupmenu 65 | GuiPopupmenu 0 66 | 67 | " Enable GUI ScrollBar 68 | GuiScrollBar 0 69 | GuiRenderLigatures 1 70 | 71 | " Right Click Context Menu (Copy-Cut-Paste) 72 | nnoremap :call GuiShowContextMenu() 73 | inoremap :call GuiShowContextMenu() 74 | xnoremap :call GuiShowContextMenu()gv 75 | snoremap :call GuiShowContextMenu()gv 76 | endif 77 | -------------------------------------------------------------------------------- /plugin/ycm.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('YouCompleteMe') 7 | finish 8 | endif 9 | 10 | let g:ycm_global_ycm_extra_conf = '~/.config/ycm/.ycm_extra_conf.py' " 默认配置文件路径 11 | let g:ycm_confirm_extra_conf=0 "打开vim时不再询问是否加载ycm_extra_conf.py配置 12 | let g:ycm_seed_identifiers_with_syntax=1 "是否开启语义补全 13 | let g:ycm_key_invoke_completion = '' "语义补全触发方式 14 | let g:ycm_semantic_triggers = { 15 | \ 'c,cpp,python,java,go,erlang,perl': ['re!\w{2}'], 16 | \ 'cs,vim,lua,javascript,swift,bash,zsh,sh': ['re!\w{2}'], 17 | \ } 18 | let g:ycm_key_list_select_completion = [''] 19 | let g:ycm_key_list_previous_completion = [''] "设置用于向上选择补全列表中的选项的快捷键, 默认爲 shift + tab, 和方向上键 20 | let g:ycm_collect_identifiers_from_comments_and_strings=1 21 | let g:ycm_min_num_of_chars_for_completion=2 "开始补全的字符数 22 | let g:ycm_max_num_candidates=50 "设置语义补全的最大候选项数量, 0 表示没有限制 23 | let g:ycm_max_num_identifier_candidates = 10 "设置标识符补全的最大候选项数量, 0 表示没有限制 24 | let g:ycm_add_preview_to_completeopt = 1 "自动弹出函数原型预览的窗口, 非常棒, 与 completeopt popup 相辅相成 25 | let g:ycm_autoclose_preview_window_after_completion=1 "补全后自动关机预览窗口 26 | let g:ycm_autoclose_preview_window_after_insertion = 1 27 | let g:ycm_use_ultisnips_completer = 1 "自动请求 ultisnips 的片段 28 | let g:ycm_show_diagnostics_ui = 0 "关闭 ycm 代码检查工具, 使用 ale 进行静态检查 29 | let g:ycm_use_clangd = 1 30 | let g:ycm_clangd_uses_ycmd_caching = 0 " Let clangd fully control code completion 31 | " let g:ycm_clangd_binary_path = '$HOMEBREW_PREFIX/opt/llvm/bin/clangd' 32 | " let g:ycm_filetype_whitelist = { 33 | " \ "c":1, 34 | " \ "cpp":1, 35 | " \ "python":1, 36 | " \ "java":1, 37 | " \ "go":1, 38 | " \ "erlang":1, 39 | " \ "perl":1, 40 | " \ "vim":1, 41 | " \ "markdown":1, 42 | " \ "swift":1, 43 | " \ "sh":1, 44 | " \ "zsh":1, 45 | " \ "zimbu":1, 46 | " \ "objc":1, 47 | " \ "yaml":1, 48 | " \ "json":1, 49 | " \ "conf":1, 50 | " \ } "文件类型白名单, vim打开这些类型文件时会开启YCM. *表示所有文件类型 51 | let g:ycm_filetype_blacklist = { 52 | \ 'tagbar' : 1, 53 | \ 'qf' : 1, 54 | \ 'notes' : 1, 55 | \ 'unite' : 1, 56 | \ 'text' : 1, 57 | \ 'vimwiki' : 1, 58 | \ 'pandoc' : 1, 59 | \ 'infolog' : 1, 60 | \ 'mail' : 1 61 | \ } "文件类型黑名单, vim打开这些类型文件时会关闭YCM 62 | " inoremap pumvisible() ? "\" : "\" 63 | let g:ycm_cache_omnifunc = 0 "禁止缓存匹配项,每次都重新生成匹配项 64 | let g:ycm_complete_in_strings=1 "字符串中也开启补全 65 | let g:ycm_complete_in_comments=1 "是否在注释中也开启补全 66 | " let g:ycm_key_list_stop_completion=[''] 67 | let g:ycm_filetype_specific_completion_to_disable={'gitcommit': 1} "语义补全黑名单, vim打开这些类型文件时会关闭YCM语义补全, 但标识符补全仍可用 68 | let g:ycm_filepath_blacklist = {'html' : 1, 'jsx' : 1,'xml' : 1,} "对特定文件类型禁用文件路径补全 69 | let g:ycm_disable_signature_help = 1 "移除函数定义的提示, 使用 echodoc 进行替代 70 | let g:ycm_auto_hover='CursorHold' "or `CursorHold` 71 | let g:ycm_clangd_args = ['-cross-file-rename'] 72 | -------------------------------------------------------------------------------- /plugin/autoformat.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-autoformat') 7 | finish 8 | endif 9 | 10 | " MARK: Config {{{ 11 | let g:autoformat_autoindent = 0 12 | let g:autoformat_retab = 1 13 | let g:autoformat_remove_trailing_spaces = 1 14 | let g:autoformat_verbosemode=1 15 | " }}} 16 | 17 | " MARK: Declare Formatter {{{ 18 | " let g:formatdef_hl_clang='"clang-format -style=\"{BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, PointerAlignment: Right, ColumnLimit: 150, SpacesBeforeTrailingComments: 1}\""' "指定格式化的方式, 使用配置参数 19 | let g:formatdef_hl_clang='"clang-format -style=file:$HOME/.clang-format"' "指定格式化的文件, 从项目路径依次向上查找 20 | let g:formatdef_hl_shfmt='"shfmt -i=4"' 21 | let g:formatdef_hl_js_beautify='"js-beautify --config ~/.config/js-beautify/.jsbeautifyrc"' 22 | let g:formatdef_hl_html_beautify='"html-beautify --config ~/.config/js-beautify/.jsbeautifyrc"' 23 | let g:formatdef_hl_css_beautify='"css-beautify --config ~/.config/js-beautify/.jsbeautifyrc"' 24 | let g:formatdef_hl_jq='"jq --indent 4"' 25 | let g:formatdef_hl_yq='"yq e -I4"' 26 | let g:formatdef_hl_sqlformat = '"sql-formatter"' 27 | let g:formatdef_hl_swiftformat = '"swiftformat --quiet"' 28 | let g:formatdef_hl_autopep8 = '"autopep8 - --global-config ~/.config/autopep8/pystyle.toml"' 29 | let g:formatdef_hl_gofmt = '"gofmt"' 30 | let g:formatdef_hl_prettier = '"prettier --stdin-filepath ".expand("%:p").(&textwidth ? " --print-width ".&textwidth : "")." --tab-width=".shiftwidth()' 31 | let g:formatdef_hl_rustfmt = '"rustfmt --edition 2018"' 32 | let g:formatdef_hl_cmake_format = '"cmake-format - -c ~/.config/cmake-format/cmake-format.yaml"' 33 | let g:formatdef_hl_rubocop = "'rubocop --auto-correct -o /dev/null -s '.bufname('%').' \| sed -n 2,\\$p'" 34 | " let g:formatdef_hl_rbeautify = '"rbeautify ".(&expandtab ? "-s -c ".shiftwidth() : "-t")' 35 | let g:formatdef_hl_dartfmt = '"dart format"' 36 | let g:formatdef_hl_perltidy = '"perltidy"' 37 | let g:formatdef_hl_latexindent = '"latexindent"' 38 | " }}} 39 | 40 | " MARK: Declare Language {{{ 41 | let g:formatters_c = ['hl_clang'] 42 | let g:formatters_cpp = ['hl_clang'] 43 | let g:formatters_objc = ['hl_clang'] 44 | let g:formatters_objcpp = ['hl_clang'] 45 | let g:formatters_json = ['hl_jq'] 46 | let g:formatters_javascript = ['hl_prettier'] 47 | let g:formatters_typescript = ['hl_prettier'] 48 | let g:formatters_html = ['hl_prettier'] 49 | let g:formatters_xml = ['hl_html_beautify'] 50 | let g:formatters_xhtml = ['hl_prettier'] 51 | let g:formatters_css = ['hl_prettier'] 52 | let g:formatters_yaml = ['hl_yq'] 53 | let g:formatters_sh = ['hl_shfmt'] 54 | let g:formatters_bash = ['hl_shfmt'] 55 | let g:formatters_zsh = ['hl_shfmt'] 56 | let g:formatters_sql = ['hl_sqlformat'] 57 | let g:formatters_mysql = ['hl_sqlformat'] 58 | let g:formatters_swift = ['hl_swiftformat'] 59 | let g:formatters_python = ['hl_autopep8'] 60 | let g:formatters_cmake = ['hl_cmake_format'] 61 | let g:formatters_ruby = ['hl_rubocop'] 62 | let g:formatters_dart = ['hl_dartfmt'] 63 | let g:formatters_rust = ['hl_rustfmt'] 64 | let g:formatters_go = ['hl_gofmt'] 65 | let g:formatters_perl = ['hl_perltidy'] 66 | let g:formatters_latex = ['hl_latexindent'] 67 | 68 | let g:formatters_markdown = [''] 69 | " }}} 70 | -------------------------------------------------------------------------------- /plugin/quickui.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-quickui') 7 | finish 8 | endif 9 | 10 | let g:quickui_border_style = 1 11 | let g:quickui_preview_w = 100 12 | let g:quickui_preview_h = 40 13 | let g:quickui_color_scheme = 'papercol dark' 14 | " enable to display tips in the cmdline 15 | let g:quickui_show_tip = 1 16 | 17 | " let content = [ 18 | " \ ["&Help Keyword\t\\ch", 'echo 100' ], 19 | " \ ["&Signature\t\\cs", 'echo 101'], 20 | " \ ['-'], 21 | " \ ["Find in &File\t\\cx", 'echo 200' ], 22 | " \ ["Find in &Project\t\\cp", 'echo 300' ], 23 | " \ ["Find in &Defintion\t\\cd", 'echo 400' ], 24 | " \ ["Search &References\t\\cr", 'echo 500'], 25 | " \ ['-'], 26 | " \ ["&Documentation\t\\cm", 'echo 600'], 27 | " \ ] 28 | " set cursor to the last position 29 | " let opts = {'index':g:quickui#context#cursor} 30 | " call quickui#context#open(content, opts) 31 | 32 | " let content = [ 33 | " \ [ 'echo 1', 'echo 100' ], 34 | " \ [ 'echo 2', 'echo 200' ], 35 | " \ [ 'echo 3', 'echo 300' ], 36 | " \ [ 'echo 4' ], 37 | " \ [ 'echo 5', 'echo 500' ], 38 | " \] 39 | " let opts = {'title': 'select one'} 40 | " call quickui#listbox#open(content, opts) 41 | 42 | " let linelist = [ 43 | " \ "line &1", 44 | " \ "line &2", 45 | " \ "line &3", 46 | " \ ] 47 | " " restore last position in previous listbox 48 | " let opts = {'index':g:quickui#listbox#cursor, 'title': 'select'} 49 | " echo quickui#listbox#inputlist(linelist, opts) 50 | 51 | " let content = [ 52 | " \ ["&Help Keyword\t\\ch", 'echo 100' ], 53 | " \ ["&Signature\t\\cs", 'echo 101'], 54 | " \ ['-'], 55 | " \ ["Find in &File\t\\cx", 'echo 200' ], 56 | " \ ["Find in &Project\t\\cp", 'echo 300' ], 57 | " \ ["Find in &Defintion\t\\cd", 'echo 400' ], 58 | " \ ["Search &References\t\\cr", 'echo 500'], 59 | " \ ['-'], 60 | " \ ["&Documentation\t\\cm", 'echo 600'], 61 | " \ ] 62 | " " set cursor to the last position 63 | " let opts = {'index':g:quickui#context#cursor} 64 | " call quickui#context#open(content, opts) 65 | 66 | " function! DisplayMessages() 67 | " let x = '' 68 | " redir => x 69 | " silent! messages 70 | " redir END 71 | " let x = substitute(x, '[\n\r]\+\%$', '', 'g') 72 | " let content = filter(split(x, "\n"), 'v:key != ""') 73 | " let opts = {"close":"button", "title":"Vim Messages"} 74 | " call quickui#textbox#open(content, opts) 75 | " endfunc 76 | 77 | " function! TermExit(code) 78 | " echom "terminal exit code: ". a:code 79 | " endfunc 80 | 81 | " let opts = {'w':60, 'h':8, 'callback':'TermExit'} 82 | " let opts.title = 'Terminal Popup' 83 | " " quick terminal 84 | " call quickui#terminal#open('python', opts) 85 | " " quick switch buffer 86 | " call quickui#tools#list_buffer('e') 87 | " call quickui#tools#list_buffer('tabedit') 88 | " " quick show all function 89 | " call quickui#tools#list_function() 90 | " " Use textbox to display vim help in a popup window 91 | " call quickui#tools#display_help('index') 92 | -------------------------------------------------------------------------------- /autoload/hl/objc.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " Automatically inserts matching bracket, TextMate style!{{{ 7 | func! hl#objc#map_match_bracket() 8 | 9 | let line = getline('.') 10 | let lnum = line('.') 11 | let col = col('.') - 1 12 | let before_cursor = strpart(line, 0, col) 13 | 14 | " Only wrap past delimeters such as ";", "*", "return", etc. But ignore delimeters in function calls. 15 | let functionPos = match(before_cursor, '\v(if|for|while)@!<\w+>\s*\(.{-}\)([;,|{}!])@!') + 1 16 | if functionPos 17 | let before_cursor = strpart(line, 0, functionPos) 18 | endif 19 | 20 | let delimPos = matchend(before_cursor, '\v.*(^|[;,|{}()!*&^%~=]|\s*return)\s*') + 1 21 | let wrap_text = strpart(before_cursor, delimPos - 1) 22 | 23 | " These are used to tell whether the bracket is still open: 24 | let left_brack_count = hl#objc#map_count(before_cursor, '[') " Note the before_cursor! 25 | let right_brack_count = hl#objc#map_count(before_cursor, ']') 26 | 27 | " Don't autocomplete if line is blank, if inside or directly outside string, or if inserting a matching bracket. 28 | if wrap_text == '' || wrap_text =~'@\=["'']\S*\s*\%'.col.'c' || hl#objc#map_count(line, '[') > hl#objc#map_count(line, ']') 29 | return ']' 30 | " Escape out of string when bracket is the next character, unless wrapping past a colon or equals sign, or inserting a closing bracket. 31 | elseif line[col] == ']' && wrap_text !~ '\v\k+:\s*\k+(\s+\k+)+$' && (before_cursor !~ '\[.*\(=\)]' || left_brack_count != right_brack_count + 1) 32 | " "]" has to be returned here or the "." command breaks. 33 | call setline(lnum, substitute(line, '\%'.(col + 1).'c.', '', '')) 34 | return ']' 35 | else 36 | " Only wrap past a colon, except for special keywords such as "@selector:". 37 | " E.g., "foo: bar|" becomes "foo: [bar |]", and "[foo bar: baz bar|]" becomes "[foo bar: [baz bar]|]" but "[foo bar: baz bar]|" becomes "[[foo bar: baz bar] |]" (where | is the cursor). 38 | let colonPos = matchend(wrap_text, '^\v(\[\k+\s+)=\k+:\s*') + 1 39 | if colonPos && colonPos > matchend(wrap_text, '\v.*\<\@(selector|operator|ope|control):') && left_brack_count != right_brack_count 40 | let delimPos += colonPos - 1 41 | endif 42 | 43 | let col -= 1 44 | " If a space or tab is already added, don't add another. 45 | if line[col] =~ '\s' 46 | let col -= 1 47 | let space = '' 48 | " Automatically append space if there is only 1 word. E.g., "foo" becomes "[foo ]", and "foo bar" becomes "[foo bar]" 49 | else 50 | let space = line[col] == ']' || wrap_text !~ '^\s*\S\+\s\+' ? ' ' : '' 51 | endif 52 | 53 | exe 'norm! i'.space.']' 54 | call cursor(lnum, delimPos) 55 | norm! i[ 56 | call cursor(lnum, col + 4) 57 | 58 | return '' 59 | endif 60 | endf 61 | "}}} 62 | 63 | " map count{{{ 64 | func! hl#objc#map_count(haystack, needle) 65 | let counter = 0 66 | let index = stridx(a:haystack, a:needle) 67 | while index != -1 68 | let counter += 1 69 | let index = stridx(a:haystack, a:needle, index + 1) 70 | endw 71 | return counter 72 | endf 73 | "}}} 74 | 75 | -------------------------------------------------------------------------------- /plugin/gutentags.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-gutentags') 7 | finish 8 | endif 9 | 10 | " gutentags 搜索工程目录的标志, 当前文件路径向上递归直到碰到这些文件/目录名 11 | let g:gutentags_project_root = g:hl_rootmarkers 12 | let g:gutentags_add_default_project_roots = 0 13 | let g:gutentags_background_update = 1 14 | let g:gutentags_exclude_project_root = [ 15 | \'/usr/local', 16 | \'/opt/homebrew', 17 | \] 18 | let al_projects = hl#fs#getDirs('$HOME/al/project') 19 | call extend(g:gutentags_exclude_project_root, al_projects) 20 | let al_modules = hl#fs#getDirs('$HOME/al/module') 21 | call extend(g:gutentags_exclude_project_root, al_modules) 22 | 23 | let g:gutentags_exclude_filetypes = [ 24 | \'gitcommit', 25 | \'gitconfig', 26 | \'gitrebase', 27 | \'gitsendemail', 28 | \'git', 29 | \'netrw', 30 | \] 31 | let g:gutentags_ctags_exclude = [ 32 | \ '*.git', '*.svn', '*.hg', 33 | \ 'cache', 'build', 'dist', 'bin', 'node_modules', 'bower_components', 34 | \ 'plugged', 'Pods', '.packages', 35 | \ 'Podfile', 36 | \ '*-lock.json', '*.lock', 37 | \ '*.min.*', 38 | \ '*.bak', 39 | \ '*.zip', 40 | \ '*.pyc', 41 | \ '*.class', 42 | \ '*.sln', 43 | \ '*.csproj', '*.csproj.user', 44 | \ '*.tmp', 45 | \ '*.cache', 46 | \ '*.vscode', 47 | \ '*.pdb', 48 | \ '*.exe', '*.dll', '*.bin', 49 | \ '*.mp3', '*.ogg', '*.flac', 50 | \ '*.swp', '*.swo', 51 | \ '.DS_Store', '*.plist', 52 | \ '*.bmp', '*.gif', '*.ico', '*.jpg', '*.png', '*.svg', 53 | \ '*.rar', '*.zip', '*.tar', '*.tar.gz', '*.tar.xz', '*.tar.bz2', 54 | \ '*.pdf', '*.doc', '*.docx', '*.ppt', '*.pptx', '*.xls', 55 | \] 56 | let g:gutentags_ctags_tagfile = '.tags' "所生成的数据文件的名称 57 | let g:gutentags_modules = [] "同时开启 ctags 和 gtags 支持: 58 | 59 | if executable('ctags') 60 | let g:gutentags_modules += ['ctags'] 61 | endif 62 | 63 | if executable('gtags-cscope') && executable('gtags') 64 | let g:gutentags_modules += ['gtags_cscope'] 65 | endif 66 | 67 | let s:vim_tags = expand('~/.cache/tags') 68 | call GuardExistDirectory(s:vim_tags) 69 | let g:gutentags_cache_dir = s:vim_tags "将自动生成的 ctags/gtags 文件全部放入 ~/.cache/tags 目录中 70 | 71 | "配置 ctags 的参数, 老的 Exuberant-ctags 不能有 --extra=+q, 注意 72 | let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extras=+q'] 73 | "l 表示local variable, 不是大写的 I 74 | let g:gutentags_ctags_extra_args += ['--c++-kinds=+pxl'] 75 | let g:gutentags_ctags_extra_args += ['--c-kinds=+pxl'] 76 | "如果使用 universal ctags 需要增加下面一行, 老的 Exuberant-ctags 不能加下一行 77 | let g:gutentags_ctags_extra_args += ['--output-format=e-ctags'] 78 | let g:gutentags_auto_add_gtags_cscope = 0 " 禁用 gutentags 自动加载 gtags 数据库的行为 79 | let g:gutentags_generate_on_new = 0 80 | let g:gutentags_generate_on_missing = 0 81 | let g:gutentags_generate_on_write = 0 82 | let g:gutentags_generate_on_empty_buffer = 0 83 | let g:gutentags_define_advanced_commands = 1 84 | " let g:gutentags_trace = 1 "将此选项打开, 发生错误后再使用 messages 查看出错的原因 85 | let g:gutentags_plus_switch = 1 86 | let g:gutentags_plus_nomap = 1 " 不使用默认映射 87 | -------------------------------------------------------------------------------- /plugin/lightline.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('lightline.vim') 7 | finish 8 | endif 9 | 10 | " \ 'tabline_separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, 11 | " \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, 12 | let g:lightline = { 13 | \ 'colorscheme': g:colors_name, 14 | \ 'subseparator': { 'left': '|', 'right': '|' }, 15 | \ 'tabline_subseparator': { 'left': '|', 'right': '|' }, 16 | \ 'active': { 17 | \ 'left': [['mode', 'paste'], 18 | \ ['gitbranch', 'readonly', 'filename', 'modified'], 19 | \ ['buffers_count', 'coc_status', 'gutentags', 'git_diff_count'] ], 20 | \ 'right': [['lineinfo'], 21 | \ ['percent'], 22 | \ ['fileformat', 'fileencoding', 'filetype']] 23 | \ }, 24 | \ 'inactive': { 25 | \ 'left': [ [ 'filename' ] ], 26 | \ 'right': [ [ 'lineinfo' ], 27 | \ [ 'percent' ] ] 28 | \ }, 29 | \ 'tabline': { 30 | \ 'left': [ [ 'tabs' ] ], 31 | \ 'right': [ [ 'close' ] ] 32 | \ }, 33 | \ 'tab': { 34 | \ 'active': [ 'tabnum', 'filename', 'modified' ], 35 | \ 'inactive': [ 'tabnum', 'filename', 'modified' ] 36 | \ }, 37 | \ 'component': { 38 | \ 'mode': '%{lightline#mode()}', 39 | \ 'absolutepath': '%F', 40 | \ 'relativepath': '%f', 41 | \ 'modified': '%M', 42 | \ 'bufnum': '%n', 43 | \ 'paste': '%{&paste?"PASTE":""}', 44 | \ 'readonly': '%R', 45 | \ 'charvalue': '%b', 46 | \ 'charvaluehex': '%B', 47 | \ 'fileencoding': '%{&fenc!=#""?&fenc:&enc}', 48 | \ 'fileformat': '%{&ff}', 49 | \ 'filetype': '%{&ft!=#""?&ft:"no ft"}', 50 | \ 'percent': '%3p%%', 51 | \ 'percentwin': '%P', 52 | \ 'spell': '%{&spell?&spelllang:""}', 53 | \ 'lineinfo': ' %3l:%-2v', 54 | \ 'line': '%l', 55 | \ 'column': '%c', 56 | \ 'close': '%999X X ', 57 | \ 'winnr': '%{winnr()}' 58 | \ }, 59 | \ 'component_visible_condition': { 60 | \ 'modified': '&modified||!&modifiable', 61 | \ 'readonly': '&readonly', 62 | \ 'paste': '&paste', 63 | \ 'spell': '&spell' 64 | \ }, 65 | \ 'component_type': { 66 | \ 'tabs': 'tabsel', 67 | \ 'close': 'raw' 68 | \ }, 69 | \ 'tab_component_function': { 70 | \ 'filename': 'lightline#tab#filename', 71 | \ 'modified': 'lightline#tab#modified', 72 | \ 'readonly': 'lightline#tab#readonly', 73 | \ 'tabnum': 'lightline#tab#tabnum' 74 | \ }, 75 | \ 'component_function': { 76 | \ 'mode': 'hl#lightline#LightlineMode', 77 | \ 'gitbranch': 'hl#lightline#LightlineFugitive', 78 | \ 'readonly': 'hl#lightline#LightlineReadonly', 79 | \ 'buffers_count': 'hl#lightline#BuffersCount', 80 | \ 'gutentags': 'gutentags#statusline', 81 | \ 'coc_status': 'hl#lightline#CocDiagnosticStatus1', 82 | \ 'git_diff_count': 'hl#lightline#GitDiffCount', 83 | \ 'filename': 'hl#lightline#FileNameWithIcon', 84 | \ }, 85 | \ } 86 | -------------------------------------------------------------------------------- /tasks.ini: -------------------------------------------------------------------------------- 1 | [file-run-inside] 2 | command="$(VIM_FILEPATH)" 3 | # command:c=gcc -Wall -O2 "$(VIM_FILEPATH)" -o "$XDG_CACHE_HOME/build/c/$(VIM_FILENOEXT)" && "$XDG_CACHE_HOME/build/c/$(VIM_FILENOEXT)" 4 | command:c=clang -x c -g -Wall -std=c99 "$(VIM_FILEPATH)" -o "$XDG_CACHE_HOME/build/c/$(VIM_FILENOEXT)" && "$XDG_CACHE_HOME/build/c/$(VIM_FILENOEXT)" 5 | command:cpp=clang++ -x c++ -g -Wall -std=c++17 "$(VIM_FILEPATH)" -o "$XDG_CACHE_HOME/build/cpp/$(VIM_FILENOEXT)" && "$XDG_CACHE_HOME/build/cpp/$(VIM_FILENOEXT)" 6 | command:objc=clang -ObjC -framework Foundation -o "$XDG_CACHE_HOME/build/objc/$(VIM_FILENOEXT)" "$(VIM_FILEPATH)" && "$XDG_CACHE_HOME/build/objc/$(VIM_FILENOEXT)" 7 | ; command:swift=swiftc "$(VIM_FILEPATH)" -o "$XDG_CACHE_HOME/build/swift/$(VIM_FILENOEXT)" && "$XDG_CACHE_HOME/build/swift/$(VIM_FILENOEXT)" 8 | command:swift=swift "$(VIM_FILEPATH)" 9 | # command:rust=rustc "$(VIM_FILEPATH)" -o "$XDG_CACHE_HOME/build/rust/$(VIM_FILENOEXT)" && "$XDG_CACHE_HOME/build/rust/$(VIM_FILENOEXT)" 10 | command:rust=rust-script "$(VIM_FILEPATH)" 11 | ; command:go=go build -o "$(VIM_FILEPATH)" "$(VIM_PATHNOEXT)" && "$(VIM_PATHNOEXT)" 12 | command:go=go run "$(VIM_FILEPATH)" 13 | command:java=java "$(VIM_FILENAME)" 14 | command:python=python "$(VIM_FILENAME)" 15 | command:javascript=node "$(VIM_FILENAME)" 16 | command:typescript=ts-node "$(VIM_FILENAME)" 17 | command:sh=sh "$(VIM_FILENAME)" 18 | command:zsh=zsh "$(VIM_FILENAME)" 19 | command:bash=bash "$(VIM_FILENAME)" 20 | command:fish=fish "$(VIM_FILENAME)" 21 | command:lua=lua "$(VIM_FILENAME)" 22 | command:perl=perl "$(VIM_FILENAME)" 23 | command:ruby=ruby "$(VIM_FILENAME)" 24 | command:php=php "$(VIM_FILENAME)" 25 | command:make=make -f "$(VIM_FILEPATH)" 26 | command:emake=emake -e "$(VIM_FILENAME)" 27 | command:erlang=escript "$(VIM_FILENAME)" 28 | command:ps1=powershell -file "$(VIM_FILENAME)" 29 | command:scala=scala "$(VIM_FILENAME)" 30 | command:haskell=ghci "$(VIM_FILENAME)" 31 | command:scheme=scheme --script "$(VIM_FILENAME)" 32 | command:applescript=osascript "$(VIM_FILENAME)" 33 | command:dart=dart "$(VIM_FILENAME)" 34 | command:vader=:TestFile 35 | ; command:vim=:source % 36 | output=terminal 37 | pos=quickfix 38 | # pos=bottom 39 | ; pos=tab # these can override g:asynctasks_term_pos 40 | cwd=$(VIM_FILEDIR) 41 | ; save=2 42 | 43 | [file-run-outside] 44 | command:html,xhtml=open -a Safari "$(VIM_FILENAME)" 45 | command:markdown=:MarkdownPreview 46 | command:plantuml=:PlantumlOpen 47 | output=terminal 48 | ; silent=1 49 | pos=vim 50 | ; pos=tab # these can override g:asynctasks_term_pos 51 | cwd=$(VIM_FILEDIR) 52 | ; save=2 53 | 54 | [project-build] 55 | command=make 56 | # set the working directory to the project root. 57 | cwd=$(VIM_ROOT) 58 | output=quickfix 59 | ; save=2 60 | 61 | [project-run] 62 | command=make run 63 | # is an alias to `$(VIM_ROOT)`, a little easier to type. 64 | cwd= 65 | ; output=quickfix 66 | output=terminal 67 | pos=quickfix 68 | ; save=2 69 | 70 | [project-build-run] 71 | command=make && make run 72 | cwd= 73 | ; output=quickfix 74 | output=terminal 75 | ; save=2 76 | 77 | 78 | ; $VIM_FILEPATH - File name of current buffer with full path 79 | ; $VIM_FILENAME - File name of current buffer without path 80 | ; $VIM_FILEDIR - Full path of current buffer without the file name 81 | ; $VIM_FILEEXT - File extension of current buffer 82 | ; $VIM_FILENOEXT - File name of current buffer without path and extension 83 | ; $VIM_CWD - Current directory 84 | ; $VIM_RELDIR - File path relativize to current directory 85 | ; $VIM_RELNAME - File name relativize to current directory 86 | ; $VIM_ROOT - Project root directory 87 | ; $VIM_CWORD - Current word under cursor 88 | ; $VIM_CFILE - Current filename under cursor 89 | ; $VIM_GUI - Is running under gui ? 90 | ; $VIM_VERSION - Value of v:version 91 | ; $VIM_COLUMNS - How many columns in vim's screen 92 | ; $VIM_LINES - How many lines in vim's screen 93 | ; $VIM_SVRNAME - Value of v:servername for +clientserver usage 94 | -------------------------------------------------------------------------------- /plugin/vim-dotoo.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | if !hl#plug_loaded('vim-dotoo') 7 | finish 8 | endif 9 | 10 | let g:dotoo#agenda#files = ['/Users/hanley/repo/hkms/*.dotoo'] 11 | let g:dotoo#capture#refile = expand('~/repo/hkms/refile.dotoo') 12 | 13 | let g:dotoo_heading_highlight_colors = [ 14 | \ 'Identifier', 15 | \ 'Constant', 16 | \ 'Title', 17 | \ 'Statement', 18 | \ 'PreProc', 19 | \ 'Type', 20 | \ 'Special' 21 | \ ] 22 | let g:dotoo_heading_shade_leading_stars = 0 23 | let g:dotoo_todo_keyword_faces = [ 24 | \ ['TODO', [':foreground 160', ':weight bold']], 25 | \ ['NEXT', [':foreground 27', ':weight bold']], 26 | \ ['DONE', [':foreground 22', ':weight bold']], 27 | \ ['WAITING', [':foreground 202', ':weight bold']], 28 | \ ['HOLD', [':foreground 53', ':weight bold']], 29 | \ ['CANCELLED', [':foreground 22', ':weight bold']], 30 | \ ['MEETING', [':foreground 22', ':weight bold']], 31 | \ ['PHONE', [':foreground 22', ':weight bold']] 32 | \ ] 33 | let g:dotoo_begin_src_languages = ['vim', 'json', 'javascript'] 34 | let g:dotoo#parser#todo_keywords = [ 35 | \ 'TODO', 36 | \ 'NEXT', 37 | \ 'WAITING', 38 | \ 'HOLD', 39 | \ 'PHONE', 40 | \ 'MEETING', 41 | \ '|', 42 | \ 'CANCELLED', 43 | \ 'DONE' 44 | \ ] 45 | let g:dotoo#agenda#warning_days = '30d' 46 | let g:dotoo#time#time_ago_short = 0 47 | let g:dotoo#capture#clock = 1 48 | let g:dotoo#capture#templates = { 49 | \ 't': { 50 | \ 'description': 'Todo', 51 | \ 'lines': [ 52 | \ '* TODO %?', 53 | \ 'DEADLINE: [%(strftime(g:dotoo#time#datetime_format))]' 54 | \ ], 55 | \ 'target': 'refile' 56 | \ }, 57 | \ 'n': { 58 | \ 'description': 'Note', 59 | \ 'lines': ['* %? :NOTE:'], 60 | \ }, 61 | \ 'm': { 62 | \ 'description': 'Meeting', 63 | \ 'lines': ['* MEETING with %? :MEETING:'], 64 | \ }, 65 | \ 'p': { 66 | \ 'description': 'Phone call', 67 | \ 'lines': ['* PHONE %? :PHONE:'], 68 | \ }, 69 | \ 'h': { 70 | \ 'description': 'Habit', 71 | \ 'lines': [ 72 | \ '* NEXT %?', 73 | \ 'SCHEDULED: [%(strftime(g:dotoo#time#date_day_format)) +1m]', 74 | \ ':PROPERTIES:', 75 | \ ':STYLE: habit', 76 | \ ':REPEAT_TO_STATE: NEXT', 77 | \ ':END:' 78 | \ ] 79 | \ } 80 | \} 81 | " let g:dotoo#capture#templates = { 82 | " \ 't': { 83 | " \ 'target': 'refile-personal:Todos' 84 | " \ } 85 | " \} 86 | 87 | " " Or add new template 88 | " let g:dotoo#capture#templates = { 89 | " \ 'x': { 90 | " \ 'description': 'eXtra template', 91 | " \ 'lines': ['* eXtra %? :EXTRA:'], 92 | " \ } 93 | " \} 94 | 95 | " " Or both 96 | " let g:dotoo#capture#templates = { 97 | " \ 't': { 98 | " \ 'target': 'refile-personal:Todos' 99 | " \ }, 100 | " \ 'x': { 101 | " \ 'description': 'eXtra template', 102 | " \ 'lines': ['* eXtra %? :EXTRA:'], 103 | " \ } 104 | " \} 105 | let g:dotoo_disable_mappings = 0 106 | let g:dotoo#agenda_views#agenda#hide_empty = 0 107 | let g:dotoo#agenda_views#agenda#start_of = 'span' 108 | let g:dotoo#agenda_views#agenda#span = 'week' 109 | " gA: Agenda 110 | " gC: Capture 111 | -------------------------------------------------------------------------------- /autoload/hl/markdown.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " 目的: 用于将 markdown 文件复制到外界 7 | " 作用: 将markdown 的多行在不影响布局的情况下合并为一段话 8 | function! hl#markdown#merge_md() 9 | %s /\([\.\,]$\)\n\(\S\)/\1 \2/g 10 | endfunction 11 | 12 | " mark markdown text bold 13 | function! hl#markdown#mark_bold(mode) 14 | call hl#operate#embedded_with_string_2(a:mode, '**', '**') 15 | endfunction 16 | 17 | function! hl#markdown#extract_bold() 18 | " call hl#operate#extract_with_string('\*\*', '\*\*') 19 | normal ds*ds* 20 | call repeat#set(":call hl#markdown#extract_bold()\") 21 | endfunction 22 | 23 | " mark markdown text italic 24 | function! hl#markdown#mark_italic(mode) 25 | call hl#operate#embedded_with_string_2(a:mode, '*', '*') 26 | endfunction 27 | 28 | " mark markdown text code 29 | function! hl#markdown#mark_code(mode) 30 | call hl#operate#embedded_with_string_2(a:mode, '`', '`') 31 | endfunction 32 | 33 | " mark markdown text deleted 34 | function! hl#markdown#mark_deleted(mode) 35 | call hl#operate#embedded_with_string_2(a:mode, '~~', '~~') 36 | endfunction 37 | 38 | function! hl#markdown#extract_deleted() 39 | " call hl#operate#extract_with_string('\*\*', '\*\*') 40 | normal ds~ds~ 41 | call repeat#set(":call hl#markdown#extract_deleted()\") 42 | endfunction 43 | 44 | " convert ' moon # Moon phase' to '- `moon`: Moon phase' 45 | function! hl#markdown#convert_hash_key_to_list() 46 | let current_line_num = line('.') 47 | let current_line_content = getline(current_line_num) 48 | let first_part_str = matchstr(current_line_content, '\s*\zs.\{-}\ze\s*\(#\|$\)') 49 | let second_part_str = matchstr(current_line_content, '.*#\s*\zs.\{-}\ze\s*$') 50 | if empty(second_part_str) 51 | let final_content = '- `' . first_part_str . '`' 52 | else 53 | let final_content = '- `' . first_part_str . '`: ' . second_part_str 54 | endif 55 | call setline(current_line_num, final_content) 56 | endfunction 57 | 58 | " format chinese{{{ 59 | function! hl#markdown#format() range 60 | " a:firstline,a:lastline call hl#Format_CN() 61 | " execute a:firstline . "," . a:lastline . " call hl#format#cn()" 62 | 63 | let regex_list = [] 64 | " 包裹的 content 添加左右两侧空格 65 | " let regex_list = add(regex_list, '/\S\{-}\zs\s*\(`[^`]\+\n*[^`]\+`\)\s*\ze/ \1 /g') 66 | " let regex_list = add(regex_list, '/\%(^\|\S\{-1,}\zs\s*\)\(`[^`]\+\n*[^`]\+`\)\s*\ze/ \1 /g') 67 | 68 | " 1. 为 inline code 添加左右空格 69 | " - \([^`]\|^\): 以非 ` 开头或 行首 开头 70 | " - \zs ... \ze: 真正要进行替换的起点与终点 71 | " - \s*\(`[^`]\_.\{-0,}`\)\s*: \_.\{-0,} 跨行代表非贪婪匹配, 整体含义为匹配以 ` 开头以 ` 结尾, 且内容为非 ` 字符必须超过一个的任意多个字符 72 | " let regex_list = add(regex_list, '/\([^`]\|^\)\zs\s*\(`[^`]\_.\{-0,}`\)\s*\ze/ \2 /g') 73 | 74 | " 2. 清除由 1 造成的副作用(行首单空格) 75 | " let regex_list = add(regex_list, '/^\s`/`/g') 76 | 77 | " 2. 清除由 1 造成的副作用(左括号后空格) 78 | " let regex_list = add(regex_list, '/(\zs\s`/`/g') 79 | 80 | " 3. 清除标点前的空格 81 | " let regex_list = add(regex_list, '/\(\S\)\s\+\([:;,.\])]\)/\1\2/g') 82 | 83 | " 4. 清除某些标点后(如 '(' '[' )的空格 84 | " let regex_list = add(regex_list, '/\([(\[]\)\s\+/\1/g') 85 | 86 | " 5. 清除尾部空格 87 | let regex_list = add(regex_list, '/\s\+$//g') 88 | 89 | " 6. 清空所有一行以上的空行 90 | let regex_list = add(regex_list, '/^\n$//g') 91 | 92 | for line_num in range(a:firstline, a:lastline) 93 | let cursor_syntax = map(synstack(line_num, 1), 'synIDattr(v:val,"name")') 94 | " 如果是 codeBlock 内容则不进行格式化 95 | let isCodeBlock = indexof(cursor_syntax, { e -> match(v:val, 'mkdSnippet') >= 0 }) >= 0 96 | " echom 'isCodeBlock: ' . isCodeBlock . 'line_num: ' . line_num . 'syntax: ' . join(cursor_syntax, ',') 97 | if !isCodeBlock 98 | execute line_num . " call hl#format#cn()" 99 | for pattern in regex_list 100 | execute line_num . " substitute " . pattern 101 | endfor 102 | endif 103 | endfor 104 | 105 | endfunction 106 | "}}} 107 | 108 | -------------------------------------------------------------------------------- /pythonx/vimsnippets.py: -------------------------------------------------------------------------------- 1 | # vim:set et fileencoding=utf8 sts=0 sw=4 ts=4: 2 | 3 | """Helper methods used in UltiSnips snippets.""" 4 | 5 | import string 6 | import vim 7 | import re 8 | 9 | # use like this: 10 | # 11 | # py3 << EOF 12 | # import vim 13 | # import vimsnippets 14 | # vimsnippets.print_hello() 15 | # EOF 16 | def print_hello(): 17 | print("hello") 18 | 19 | def complete(tab, opts): 20 | """ 21 | get options that match with tab 22 | 23 | :param tab: query string 24 | :param opts: list that needs to be completed 25 | 26 | :return: a string that match with tab 27 | """ 28 | el = [x for x in tab] 29 | pat = "".join(list(map(lambda x: x + "\w*" if re.match("\w", x) else x, 30 | el))) 31 | try: 32 | opts = [x for x in opts if re.search(pat, x, re.IGNORECASE)] 33 | except BaseException: 34 | opts = [x for x in opts if x.startswith(tab)] 35 | if not len(opts) or str.lower(tab) in list(map(str.lower, opts)): 36 | return "" 37 | cads = "|".join(opts[:5]) 38 | if len(opts) > 5: 39 | cads += "|..." 40 | return "({0})".format(cads) 41 | 42 | 43 | def _parse_comments(s): 44 | """ Parses vim's comments option to extract comment format """ 45 | i = iter(s.split(",")) 46 | 47 | rv = [] 48 | try: 49 | while True: 50 | # get the flags and text of a comment part 51 | flags, text = next(i).split(':', 1) 52 | 53 | if len(flags) == 0: 54 | rv.append(('OTHER', text, text, text, "")) 55 | # parse 3-part comment, but ignore those with O flag 56 | elif 's' in flags and 'O' not in flags: 57 | ctriple = ["TRIPLE"] 58 | indent = "" 59 | 60 | if flags[-1] in string.digits: 61 | indent = " " * int(flags[-1]) 62 | ctriple.append(text) 63 | 64 | flags, text = next(i).split(':', 1) 65 | assert flags[0] == 'm' 66 | ctriple.append(text) 67 | 68 | flags, text = next(i).split(':', 1) 69 | assert flags[0] == 'e' 70 | ctriple.append(text) 71 | ctriple.append(indent) 72 | 73 | rv.append(ctriple) 74 | elif 'b' in flags: 75 | if len(text) == 1: 76 | rv.insert(0, ("SINGLE_CHAR", text, text, text, "")) 77 | except StopIteration: 78 | return rv 79 | 80 | 81 | def get_comment_format(): 82 | """ Returns a 4-element tuple (first_line, middle_lines, end_line, indent) 83 | representing the comment format for the current file. 84 | 85 | It first looks at the 'commentstring', if that ends with %s, it uses that. 86 | Otherwise it parses '&comments' and prefers single character comment 87 | markers if there are any. 88 | """ 89 | commentstring = vim.eval("&commentstring") 90 | if commentstring.endswith("%s"): 91 | c = commentstring[:-2] 92 | return (c.rstrip(), c.rstrip(), c.rstrip(), "") 93 | comments = _parse_comments(vim.eval("&comments")) 94 | for c in comments: 95 | if c[0] == "SINGLE_CHAR": 96 | return c[1:] 97 | return comments[0][1:] 98 | 99 | 100 | def make_box(twidth, bwidth=None): 101 | b, m, e, i = (s.strip() for s in get_comment_format()) 102 | m0 = m[0] if m else '' 103 | bwidth_inner = bwidth - 3 - max(len(b), len(i + e)) if bwidth else twidth + 2 104 | sline = b + m + bwidth_inner * m0 + 2 * m0 105 | nspaces = (bwidth_inner - twidth) // 2 106 | mlines = i + m + " " + " " * nspaces 107 | mlinee = " " + " " * (bwidth_inner - twidth - nspaces) + m 108 | eline = i + m + bwidth_inner * m0 + 2 * m0 + e 109 | return sline, mlines, mlinee, eline 110 | 111 | 112 | def foldmarker(): 113 | "Return a tuple of (open fold marker, close fold marker)" 114 | return vim.eval("&foldmarker").split(",") 115 | 116 | 117 | def display_width(str): 118 | """Return the required over-/underline length for str.""" 119 | try: 120 | # Respect &ambiwidth and &tabstop, but old vim may not support this 121 | return vim.strdisplaywidth(str) 122 | except AttributeError: 123 | # Fallback 124 | from unicodedata import east_asian_width 125 | result = 0 126 | for c in str: 127 | result += 2 if east_asian_width(c) in ('W', 'F') else 1 128 | return result 129 | 130 | # http://stackoverflow.com/questions/2718196/find-all-chinese-text-in-a-string-using-python-and-regex 131 | 132 | 133 | def has_cjk(s): 134 | """Detect if s contains CJK characters.""" 135 | cjk_re = re.compile(u'[⺀-⺙⺛-⻳⼀-⿕々〇〡-〩〸-〺〻㐀-䶵一-鿃豈-鶴侮-頻並-龎]', re.UNICODE) 136 | 137 | return cjk_re.search(s) is not None 138 | -------------------------------------------------------------------------------- /autoload/hl/util.vim: -------------------------------------------------------------------------------- 1 | " Author: Hanley Lee 2 | " Website: https://www.hanleylee.com 3 | " GitHub: https://github.com/hanleylee 4 | " License: MIT License 5 | 6 | " echo path 7 | func! hl#util#EchoPath() 8 | echo hl#fs#getFullPathName() 9 | endfunc 10 | 11 | " echo runtimepath 12 | func! hl#util#EchoRunPath() 13 | for I in split(&rtp, ',') 14 | echo I 15 | endfor 16 | endfunction 17 | 18 | " add path to vim from environment variables 19 | " This is a list of directories which will be searched when using the 20 | " |gf|, [f, ]f, ^Wf, |:find|, |:sfind|, |:tabfind| and other commands 21 | function! hl#util#ExpandPathFromEnv(paths_arr) 22 | " for path_str in a:000 23 | for path_str in a:paths_arr 24 | let paths=split(path_str, ':') 25 | 26 | for path in paths 27 | let expanded_path = expand(path) 28 | if isdirectory(expanded_path) 29 | execute 'set path+=' . expanded_path 30 | endif 31 | endfor 32 | endfor 33 | endfunction 34 | 35 | " makes * and # work on visual mode too. global function so user mappings can call it. specifying 'raw' for the second argument prevents escaping the result for vimgrep 36 | " TODO: there's a bug with raw mode. since we're using @/ to return an unescaped search string, vim's search highlight will be wrong. Refactor plz. 37 | function! hl#util#VisualStarSearchSet(cmdtype,...) 38 | let temp = @" 39 | normal! gvy 40 | if !a:0 || a:1 != 'raw' 41 | let @" = escape(@", a:cmdtype.'\*') 42 | endif 43 | let @/ = substitute(@", '\n', '\\n', 'g') 44 | let @/ = substitute(@/, '\[', '\\[', 'g') 45 | let @/ = substitute(@/, '\~', '\\~', 'g') 46 | let @/ = substitute(@/, '\.', '\\.', 'g') 47 | let @" = temp 48 | endfunction 49 | 50 | function! hl#util#ShouldMakeView() 51 | if has('quickfix') && &buftype =~ 'nofile' 52 | " Buffer is marked as not a file 53 | return 0 54 | endif 55 | if empty(glob(expand('%:p'))) 56 | " File does not exist on disk 57 | return 0 58 | endif 59 | if len($TEMP) && expand('%:p:h') == $TEMP 60 | " We're in a temp dir 61 | return 0 62 | endif 63 | if len($TMP) && expand('%:p:h') == $TMP 64 | " Also in temp dir 65 | return 0 66 | endif 67 | if index(g:skipview_files, expand('%')) >= 0 68 | " File is in skip list 69 | return 0 70 | endif 71 | return 1 72 | endfunction 73 | 74 | " Permanently delete views created by 'mkview' 75 | function! hl#util#DeleteView() 76 | let path = fnamemodify(bufname('%'), ':p') 77 | " vim's odd =~ escaping for / 78 | let path = substitute(path, '=', '==', 'g') 79 | if empty($HOME) 80 | else 81 | let path = substitute(path, '^' . $HOME, '\~', '') 82 | endif 83 | let path = substitute(path, '/', '=+', 'g') . '=' 84 | " view directory 85 | let path = &viewdir . '/' . path 86 | call delete(path) 87 | echo "Deleted: " . path 88 | endfunction 89 | 90 | function! hl#util#ConvertUnixUtf8() 91 | set fileformat=unix 92 | set fileencoding=utf-8 93 | w 94 | endfunction 95 | 96 | function! hl#util#SearchMatchCount() 97 | " 获取当前搜索模式 98 | let l:pattern = @/ 99 | " 如果搜索模式为空,返回空字符串 100 | if empty(l:pattern) 101 | return '' 102 | endif 103 | 104 | let l:search_res = searchcount({'maxcount': 0}) 105 | let l:current = l:search_res.current 106 | let l:total = l:search_res.total 107 | 108 | " 返回匹配数 109 | echo l:current . '/' . l:total 110 | endfunction 111 | 112 | function! hl#util#AutoIM(event) 113 | if a:event == 'leave' 114 | call hl#external#RunJobCaptureResult(['macism'], 'b:pre_insert_im') 115 | call hl#external#RunJob(['macism', 'com.apple.keylayout.ABC']) 116 | else " a:event == 'enter' 117 | if exists('b:pre_insert_im') 118 | call hl#external#RunJob(['macism', b:pre_insert_im]) 119 | " call system('macism ' . b:pre_insert_im) 120 | endif 121 | end 122 | endfunction 123 | 124 | let s:loaded_config_path_dic = {} 125 | let s:checked_config_dir_dict = {} 126 | function! hl#util#SafelySourceProjectConfig() 127 | let cur_dir = expand("%:p:h") 128 | if has_key(s:checked_config_dir_dict, cur_dir) 129 | return 130 | endif 131 | 132 | let s:checked_config_dir_dict[cur_dir] = 1 133 | 134 | let vimrc_file = findfile(".vimrc", cur_dir . ';') 135 | let vimrc_path = fnamemodify(vimrc_file, ":p") 136 | if filereadable(vimrc_path) 137 | if !has_key(s:loaded_config_path_dic, vimrc_path) 138 | " for dir in g:project_config_load_whitelist 139 | " if cwd =~ dir 140 | execute "source " . vimrc_path 141 | redraw! | echom "Config file: '" . vimrc_path . "' is sourced!" 142 | let s:loaded_config_path_dic[vimrc_path] = 1 143 | return 144 | " endif 145 | " endfor 146 | endif 147 | endif 148 | endfunction 149 | 150 | -------------------------------------------------------------------------------- /autoload/airline/themes/gruvbox.vim: -------------------------------------------------------------------------------- 1 | " ----------------------------------------------------------------------------- 2 | " File: gruvbox.vim 3 | " Description: Retro groove color scheme for Airline 4 | " Author: morhetz 5 | " Source: https://github.com/morhetz/gruvbox 6 | " Last Modified: 12 Aug 2017 7 | " ----------------------------------------------------------------------------- 8 | 9 | let g:airline#themes#gruvbox#palette = {} 10 | 11 | function! airline#themes#gruvbox#refresh() 12 | 13 | let M0 = airline#themes#get_highlight('Identifier') 14 | let accents_group = airline#themes#get_highlight('Special') 15 | let modified_group = [M0[0], '', M0[2], '', ''] 16 | let warning_group = airline#themes#get_highlight2(['Normal', 'bg'], ['Question', 'fg']) 17 | let error_group = airline#themes#get_highlight2(['Normal', 'bg'], ['WarningMsg', 'fg']) 18 | 19 | let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['StatusLineNC', 'bg']) 20 | let s:N2 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['Pmenu', 'bg']) 21 | let s:N3 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['CursorLine', 'bg']) 22 | let g:airline#themes#gruvbox#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 23 | let g:airline#themes#gruvbox#palette.normal_modified = { 'airline_c': modified_group } 24 | let g:airline#themes#gruvbox#palette.normal.airline_warning = warning_group 25 | let g:airline#themes#gruvbox#palette.normal_modified.airline_warning = warning_group 26 | let g:airline#themes#gruvbox#palette.normal.airline_error = error_group 27 | let g:airline#themes#gruvbox#palette.normal_modified.airline_error = error_group 28 | 29 | let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Identifier', 'fg']) 30 | let s:I2 = s:N2 31 | let s:I3 = airline#themes#get_highlight2(['Normal', 'fg'], ['Pmenu', 'bg']) 32 | let g:airline#themes#gruvbox#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 33 | let g:airline#themes#gruvbox#palette.insert_modified = g:airline#themes#gruvbox#palette.normal_modified 34 | let g:airline#themes#gruvbox#palette.insert.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning 35 | let g:airline#themes#gruvbox#palette.insert_modified.airline_warning = g:airline#themes#gruvbox#palette.normal_modified.airline_warning 36 | let g:airline#themes#gruvbox#palette.insert.airline_error = g:airline#themes#gruvbox#palette.normal.airline_error 37 | let g:airline#themes#gruvbox#palette.insert_modified.airline_error = g:airline#themes#gruvbox#palette.normal_modified.airline_error 38 | 39 | let s:R1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Structure', 'fg']) 40 | let s:R2 = s:I2 41 | let s:R3 = s:I3 42 | let g:airline#themes#gruvbox#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) 43 | let g:airline#themes#gruvbox#palette.replace_modified = g:airline#themes#gruvbox#palette.normal_modified 44 | let g:airline#themes#gruvbox#palette.replace.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning 45 | let g:airline#themes#gruvbox#palette.replace_modified.airline_warning = g:airline#themes#gruvbox#palette.normal_modified.airline_warning 46 | let g:airline#themes#gruvbox#palette.replace.airline_error = g:airline#themes#gruvbox#palette.normal.airline_error 47 | let g:airline#themes#gruvbox#palette.replace_modified.airline_error = g:airline#themes#gruvbox#palette.normal_modified.airline_error 48 | 49 | let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Question', 'fg']) 50 | let s:V2 = s:N2 51 | let s:V3 = airline#themes#get_highlight2(['Normal', 'bg'], ['TabLine', 'fg']) 52 | let g:airline#themes#gruvbox#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 53 | let g:airline#themes#gruvbox#palette.visual_modified = { 'airline_c': [ s:V3[0], '', s:V3[2], '', '' ] } 54 | let g:airline#themes#gruvbox#palette.visual.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning 55 | let g:airline#themes#gruvbox#palette.visual_modified.airline_warning = g:airline#themes#gruvbox#palette.normal_modified.airline_warning 56 | let g:airline#themes#gruvbox#palette.visual.airline_error = g:airline#themes#gruvbox#palette.normal.airline_error 57 | let g:airline#themes#gruvbox#palette.visual_modified.airline_error = g:airline#themes#gruvbox#palette.normal_modified.airline_error 58 | 59 | let s:IA = airline#themes#get_highlight2(['TabLine', 'fg'], ['CursorLine', 'bg']) 60 | let g:airline#themes#gruvbox#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 61 | let g:airline#themes#gruvbox#palette.inactive_modified = { 'airline_c': modified_group } 62 | 63 | let g:airline#themes#gruvbox#palette.accents = { 'red': accents_group } 64 | 65 | let s:TF = airline#themes#get_highlight2(['Normal', 'bg'], ['Normal', 'bg']) 66 | let g:airline#themes#gruvbox#palette.tabline = { 67 | \ 'airline_tab': s:N2, 68 | \ 'airline_tabsel': s:N1, 69 | \ 'airline_tabtype': s:V1, 70 | \ 'airline_tabfill': s:TF, 71 | \ 'airline_tabhid': s:IA, 72 | \ 'airline_tabmod': s:I1 73 | \ } 74 | 75 | endfunction 76 | 77 | call airline#themes#gruvbox#refresh() 78 | 79 | " vim: set sw=2 ts=2 sts=2 et tw=80 ft=vim fdm=marker: 80 | --------------------------------------------------------------------------------