├── .github └── workflows │ ├── jq.yml │ ├── neovim.yml │ ├── reviewdog.yml │ └── vim.yml ├── LICENSE ├── LICENSE.vim-devicon ├── README.md ├── assets └── json │ ├── basename.json │ ├── directory.json │ ├── extension.json │ ├── fileformat.json │ ├── pattern.json │ └── platform.json ├── autoload ├── nerdfont.vim └── nerdfont │ ├── cellwidths.vim │ ├── directory.vim │ ├── fileformat.vim │ ├── path │ ├── basename.vim │ ├── extension.vim │ └── pattern.vim │ └── platform.vim ├── doc ├── .gitignore └── nerdfont.txt ├── plugin └── nerdfont.vim └── test ├── .themisrc ├── nerdfont ├── directory.vimspec ├── fileformat.vimspec ├── path │ ├── basename.vimspec │ ├── extension.vimspec │ └── pattern.vimspec └── platform.vimspec └── run_themis.sh /.github/workflows/jq.yml: -------------------------------------------------------------------------------- 1 | name: JSON check 2 | 3 | on: 4 | push: 5 | paths: 6 | - assets/json/*.json 7 | pull_request: 8 | paths: 9 | - assets/json/*.json 10 | workflow_dispatch: 11 | 12 | jobs: 13 | test: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | - name: Check if a json is sorted 18 | run: | 19 | for json in assets/json/*.json ; do 20 | diff <(jq -S . $json) $json || exit 1 21 | done 22 | -------------------------------------------------------------------------------- /.github/workflows/neovim.yml: -------------------------------------------------------------------------------- 1 | name: Neovim 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | os: 16 | - macos-latest 17 | - windows-latest 18 | - ubuntu-latest 19 | version: 20 | - stable 21 | - v0.4.4 22 | runs-on: ${{ matrix.os }} 23 | steps: 24 | - uses: actions/checkout@v4 25 | - uses: actions/checkout@v4 26 | with: 27 | repository: thinca/vim-themis 28 | path: vim-themis 29 | - uses: rhysd/action-setup-vim@v1 30 | id: nvim 31 | with: 32 | neovim: true 33 | version: "${{ matrix.version }}" 34 | - name: Run tests 35 | env: 36 | THEMIS_VIM: ${{ steps.nvim.outputs.executable }} 37 | # XXX: 38 | # Overwrite %TMP% to point a correct temp directory. 39 | # Note that %TMP% only affects value of 'tempname()' in Windows. 40 | # https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427 41 | TMP: 'C:\Users\runneradmin\AppData\Local\Temp' 42 | run: | 43 | ./vim-themis/bin/themis 44 | -------------------------------------------------------------------------------- /.github/workflows/reviewdog.yml: -------------------------------------------------------------------------------- 1 | name: reviewdog 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | vimlint: 13 | name: runner / vint 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: vint 18 | uses: reviewdog/action-vint@v1 19 | with: 20 | github_token: ${{ secrets.github_token }} 21 | level: error 22 | reporter: github-pr-review 23 | -------------------------------------------------------------------------------- /.github/workflows/vim.yml: -------------------------------------------------------------------------------- 1 | name: Vim 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | jobs: 11 | test: 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | os: 16 | - macos-latest 17 | - windows-latest 18 | - ubuntu-latest 19 | version: 20 | - nightly 21 | - v8.2.5136 # https://github.com/lambdalisue/vim-fern/issues/506 22 | runs-on: ${{ matrix.os }} 23 | steps: 24 | - uses: actions/checkout@v4 25 | - uses: actions/checkout@v4 26 | with: 27 | repository: thinca/vim-themis 28 | path: vim-themis 29 | - uses: rhysd/action-setup-vim@v1 30 | id: vim 31 | with: 32 | version: "${{ matrix.version }}" 33 | - name: Run tests 34 | env: 35 | THEMIS_VIM: ${{ steps.vim.outputs.executable }} 36 | # XXX: 37 | # Overwrite %TMP% to point a correct temp directory. 38 | # Note that %TMP% only affects value of 'tempname()' in Windows. 39 | # https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427 40 | TMP: 'C:\Users\runneradmin\AppData\Local\Temp' 41 | run: | 42 | ./vim-themis/bin/themis 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Alisue, hashnote.net 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /LICENSE.vim-devicon: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Ryan L McIntyre 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 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 👓 nerdfont.vim 2 | 3 | ![Support Vim 8.2.5136 or above](https://img.shields.io/badge/support-Vim%208.2.5136%20or%20above-yellowgreen.svg) 4 | ![Support Neovim 0.4.4 or above](https://img.shields.io/badge/support-Neovim%200.4.4%20or%20above-yellowgreen.svg) 5 | [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) 6 | [![Doc](https://img.shields.io/badge/doc-%3Ah%20nerdfont-orange.svg)](doc/nerdfont.txt) 7 | 8 | [![reviewdog](https://github.com/lambdalisue/nerdfont.vim/workflows/reviewdog/badge.svg)](https://github.com/lambdalisue/nerdfont.vim/actions?query=workflow%3Areviewdog) 9 | [![Vim](https://github.com/lambdalisue/vim-nerdfont/actions/workflows/vim.yml/badge.svg)](https://github.com/lambdalisue/vim-nerdfont/actions/workflows/vim.yml) 10 | [![Neovim](https://github.com/lambdalisue/vim-nerdfont/actions/workflows/neovim.yml/badge.svg)](https://github.com/lambdalisue/vim-nerdfont/actions/workflows/neovim.yml) 11 | 12 | A simplified version of [vim-devicons][] which does NOT provide any 3rd party integrations in itself. 13 | In otherwords, it is a fundemental plugin to handle [Nerd Fonts][] from Vim. 14 | 15 | [vim-devicons]: https://github.com/ryanoasis/vim-devicons 16 | [nerd fonts]: https://github.com/ryanoasis/nerd-fonts 17 | 18 | ![](https://user-images.githubusercontent.com/546312/88701008-6c1c5980-d144-11ea-8d6b-d4f4290274a6.png) 19 | _With fern.vim + fern-renderer-nerdfont.vim. All glyphs above were powered by this plugin_ 20 | 21 | ## Usage 22 | 23 | First of all, make sure one of [Nerd Fonts][] is used in your Vim. 24 | After that, use `nerdfont#find()` function to find a glyph for the current filetype like: 25 | 26 | ```vim 27 | echo nerdfont#find() 28 |  29 | ``` 30 | 31 | Or specify a path to find a glyph for a particular path like: 32 | 33 | ```vim 34 | echo nerdfont#find(expand('~/.vimrc')) 35 |  36 | echo nerdfont#find(expand('~/.vim')) 37 |  38 | ``` 39 | 40 | Above automatically check if the specified path is directory. 41 | To avoid that, specify the second argument to tell if the path is directory or not like: 42 | 43 | ```vim 44 | echo nerdfont#find(expand('~/.vimrc'), 0) 45 |  46 | echo nerdfont#find(expand('~/.vimrc'), 1) 47 |  48 | ``` 49 | 50 | See `:help nerdfont-function` to find glyphs for directory, fileformat, platform, etc. 51 | 52 | ## Contribution 53 | 54 | If you would like to add new glyph/filetype supports, see the following files 55 | 56 | | If | Where | 57 | | --------------------------------------------------- | ------------------------------------------------------------ | 58 | | Want to add new extension (e.g. `.js`) | [`assets/json/extension.json`](./assets/json/extension.json) | 59 | | Want to add new exact name (e.g. `Makefile`) | [`assets/json/basename.json`](./assets/json/basename.json) | 60 | | Want to add new complex pattern (e.g. `.*/bin/.*$`) | [`assets/json/pattern.json`](./assets/json/pattern.json) | 61 | 62 | ## Integrations 63 | 64 | See [Integration section](https://github.com/lambdalisue/nerdfont.vim/wiki#integrations) of Wiki. 65 | 66 | ## License 67 | 68 | The glyph mappings has copied from [vim-devicons][] thus the part follow the license of [vim-devicons][] ([LICENSE.vim-devicons](./LICENSE.vim-devicon)). 69 | Other parts are MIT license explained in [LICENSE](./LICENSE). 70 | -------------------------------------------------------------------------------- /assets/json/basename.json: -------------------------------------------------------------------------------- 1 | { 2 | "._ds_store": "", 3 | ".aliases": "󱆃", 4 | ".atom": "", 5 | ".bash_aliases": "󱆃", 6 | ".bash_history": "󱆃", 7 | ".bash_logout": "󱆃", 8 | ".bash_profile": "󱆃", 9 | ".bashrc": "󱆃", 10 | ".cfusertextencoding": "", 11 | ".clang-format": "", 12 | ".clang-tidy": "", 13 | ".codespellrc": "󰓆", 14 | ".condarc": "", 15 | ".cshrc": "󱆃", 16 | ".ds_store": "", 17 | ".editorconfig": "", 18 | ".emacs": "", 19 | ".envrc": "", 20 | ".eslintignore": "", 21 | ".eslintrc.cjs": "", 22 | ".eslintrc.js": "", 23 | ".eslintrc.json": "", 24 | ".eslintrc.yaml": "", 25 | ".eslintrc.yml": "", 26 | ".fennelrc": "", 27 | ".gcloudignore": "󱇶", 28 | ".git": "", 29 | ".git-blame-ignore-revs": "", 30 | ".gitattributes": "", 31 | ".gitconfig": "", 32 | ".gitignore": "", 33 | ".gitignore_global": "", 34 | ".gitlab-ci.yml": "", 35 | ".gitmodules": "", 36 | ".gtkrc-2.0": "", 37 | ".gvimrc": "", 38 | ".htaccess": "", 39 | ".htpasswd": "", 40 | ".idea": "", 41 | ".ideavimrc": "", 42 | ".inputrc": "", 43 | ".kshrc": "󱆃", 44 | ".login": "󱆃", 45 | ".logout": "󱆃", 46 | ".luacheckrc": "", 47 | ".luaurc": "", 48 | ".mailmap": "", 49 | ".nanorc": "", 50 | ".node_repl_history": "", 51 | ".npmignore": "", 52 | ".npmrc": "", 53 | ".nuxtrc": "󱄆", 54 | ".parentlock": "", 55 | ".pre-commit-config.yaml": "󰛢", 56 | ".prettierignore": "", 57 | ".prettierrc": "", 58 | ".profile": "󱆃", 59 | ".pylintrc": "", 60 | ".python_history": "", 61 | ".rustfmt.toml": "", 62 | ".rvm": "", 63 | ".rvmrc": "", 64 | ".srcinfo": "", 65 | ".tcshrc": "󱆃", 66 | ".viminfo": "", 67 | ".vimrc": "", 68 | ".xauthority": "", 69 | ".xinitrc": "", 70 | ".xresources": "", 71 | ".yarnrc": "", 72 | ".zlogin": "󱆃", 73 | ".zlogout": "󱆃", 74 | ".zprofile": "󱆃", 75 | ".zsh_history": "󱆃", 76 | ".zsh_sessions": "󱆃", 77 | ".zshenv": "󱆃", 78 | ".zshrc": "󱆃", 79 | "_gvimrc": "", 80 | "_vimrc": "", 81 | "a.out": "", 82 | "authorized_keys": "󰣀", 83 | "authors": "", 84 | "authors.txt": "", 85 | "bashrc": "󱆃", 86 | "brewfile": "󱄖", 87 | "brewfile.lock.json": "󱄖", 88 | "bspwmrc": "", 89 | "build.gradle.kts": "", 90 | "build.zig.zon": "", 91 | "bun.lockb": "", 92 | "cantorrc": "", 93 | "cargo.lock": "", 94 | "cargo.toml": "", 95 | "cmakelists.txt": "", 96 | "code_of_conduct": "", 97 | "code_of_conduct.md": "", 98 | "commit_editmsg": "", 99 | "compose.yaml": "", 100 | "compose.yml": "", 101 | "composer.json": "", 102 | "composer.lock": "", 103 | "config": "", 104 | "config.ru": "", 105 | "config.status": "", 106 | "configure": "", 107 | "configure.ac": "", 108 | "configure.in": "", 109 | "constraints.txt": "", 110 | "copying": "", 111 | "copyright": "", 112 | "crontab": "", 113 | "crypttab": "", 114 | "csh.cshrc": "󱆃", 115 | "csh.login": "󱆃", 116 | "csh.logout": "󱆃", 117 | "docker-compose.yaml": "", 118 | "docker-compose.yml": "", 119 | "dockerfile": "", 120 | "dropbox": "", 121 | "ds_store": "", 122 | "dune": "", 123 | "dune-project": "", 124 | "earthfile": "", 125 | "environment": "", 126 | "exact-match-case-sensitive-1.txt": "1", 127 | "exact-match-case-sensitive-2": "2", 128 | "favicon.ico": "", 129 | "fennelrc": "", 130 | "fonts.conf": "", 131 | "fp-info-cache": "", 132 | "fp-lib-table": "", 133 | "freecad.conf": "", 134 | "gemfile": "", 135 | "gitignore_global": "", 136 | "gnumakefile": "", 137 | "go.mod": "", 138 | "go.sum": "", 139 | "go.work": "", 140 | "gradle": "", 141 | "gradle.properties": "", 142 | "gradlew": "", 143 | "gradlew.bat": "", 144 | "group": "", 145 | "gruntfile.coffee": "", 146 | "gruntfile.js": "", 147 | "gruntfile.ls": "", 148 | "gshadow": "", 149 | "gtkrc": "", 150 | "gulpfile.coffee": "", 151 | "gulpfile.js": "", 152 | "gulpfile.ls": "", 153 | "heroku.yml": "", 154 | "hidden": "", 155 | "hostname": "", 156 | "hypridle.conf": "", 157 | "hyprland.conf": "", 158 | "hyprlock.conf": "", 159 | "hyprpaper.conf": "", 160 | "i3blocks.conf": "", 161 | "i3status.conf": "", 162 | "id_dsa": "󰌆", 163 | "id_ecdsa": "󰌆", 164 | "id_ecdsa_sk": "󰌆", 165 | "id_ed25519": "󰌆", 166 | "id_ed25519_sk": "󰌆", 167 | "id_rsa": "󰌆", 168 | "index.theme": "", 169 | "inputrc": "", 170 | "jenkinsfile": "", 171 | "jsconfig.json": "", 172 | "justfile": "", 173 | "kalgebrarc": "", 174 | "kdeglobals": "", 175 | "kdenlive-layoutsrc": "", 176 | "kdenliverc": "", 177 | "known_hosts": "󰣀", 178 | "kritadisplayrc": "", 179 | "kritarc": "", 180 | "licence": "", 181 | "licence.md": "", 182 | "licence.txt": "", 183 | "license": "", 184 | "license-apache": "", 185 | "license-mit": "", 186 | "license.md": "", 187 | "license.txt": "", 188 | "localized": "", 189 | "localtime": "", 190 | "lock": "", 191 | "log": "", 192 | "lxde-rc.xml": "", 193 | "lxqt.conf": "", 194 | "makefile": "", 195 | "makefile.ac": "", 196 | "makefile.am": "", 197 | "makefile.in": "", 198 | "manifest": "", 199 | "manifest.in": "", 200 | "mix.lock": "", 201 | "mpv.conf": "", 202 | "npm-shrinkwrap.json": "", 203 | "npmignore": "", 204 | "npmrc": "", 205 | "package-lock.json": "", 206 | "package.json": "", 207 | "passwd": "", 208 | "php.ini": "", 209 | "pkgbuild": "", 210 | "platformio.ini": "", 211 | "pom.xml": "", 212 | "procfile": "", 213 | "profile": "󱆃", 214 | "prusaslicer.ini": "", 215 | "prusaslicergcodeviewer.ini": "", 216 | "pyproject.toml": "", 217 | "pyvenv.cfg": "", 218 | "qt5ct.conf": "", 219 | "qt6ct.conf": "", 220 | "qtproject.conf": "", 221 | "rakefile": "", 222 | "readme": "󰂺", 223 | "readme.md": "󰂺", 224 | "release.toml": "", 225 | "renovate.json": "󰉼", 226 | "requirements.txt": "", 227 | "robots.txt": "󰚩", 228 | "rubydoc": "", 229 | "rvmrc": "", 230 | "security": "󰒃", 231 | "security.md": "󰒃", 232 | "settings.gradle.kts": "", 233 | "shadow": "", 234 | "shells": "", 235 | "sudoers": "", 236 | "sxhkdrc": "", 237 | "sym-lib-table": "", 238 | "timezone": "", 239 | "tmux.conf": "", 240 | "tmux.conf.local": "", 241 | "tsconfig.json": "", 242 | "vagrantfile": "⍱", 243 | "vlcrc": "󰕼", 244 | "webpack.config.js": "󰜫", 245 | "weston.ini": "", 246 | "xmobarrc": "", 247 | "xmobarrc.hs": "", 248 | "xmonad.hs": "", 249 | "yarn.lock": "", 250 | "zlogin": "󱆃", 251 | "zlogout": "󱆃", 252 | "zprofile": "󱆃", 253 | "zshenv": "󱆃", 254 | "zshrc": "󱆃" 255 | } 256 | -------------------------------------------------------------------------------- /assets/json/directory.json: -------------------------------------------------------------------------------- 1 | { 2 | ".": "", 3 | "close": "", 4 | "open": "", 5 | "symlink": "" 6 | } 7 | -------------------------------------------------------------------------------- /assets/json/extension.json: -------------------------------------------------------------------------------- 1 | { 2 | ".": "", 3 | "123dx": "󰻫", 4 | "3dm": "󰻫", 5 | "3g2": "", 6 | "3gp": "", 7 | "3gp2": "", 8 | "3gpp": "", 9 | "3gpp2": "", 10 | "3mf": "󰆧", 11 | "7z": "", 12 | "a": "", 13 | "aac": "", 14 | "acf": "", 15 | "age": "󰦝", 16 | "ai": "", 17 | "aif": "", 18 | "aifc": "", 19 | "aiff": "", 20 | "alac": "", 21 | "android": "", 22 | "ape": "", 23 | "apk": "", 24 | "app": "", 25 | "apple": "", 26 | "applescript": "", 27 | "ar": "", 28 | "arj": "", 29 | "arw": "", 30 | "asc": "󰦝", 31 | "asm": "", 32 | "asp": "", 33 | "ass": "󰨖", 34 | "avi": "", 35 | "avif": "", 36 | "avro": "", 37 | "awk": "", 38 | "bash": "", 39 | "bat": "", 40 | "bats": "", 41 | "bdf": "", 42 | "bib": "", 43 | "bin": "", 44 | "blend": "󰂫", 45 | "bmp": "", 46 | "br": "", 47 | "brd": "", 48 | "brep": "󰻫", 49 | "bst": "", 50 | "bundle": "", 51 | "bz": "", 52 | "bz2": "", 53 | "bz3": "", 54 | "c": "", 55 | "c++": "", 56 | "cab": "", 57 | "cache": "", 58 | "cast": "", 59 | "catpart": "󰻫", 60 | "catproduct": "󰻫", 61 | "cbr": "", 62 | "cbz": "", 63 | "cc": "", 64 | "cert": "", 65 | "cfg": "", 66 | "cjs": "", 67 | "class": "", 68 | "clj": "", 69 | "cljc": "", 70 | "cljs": "", 71 | "cls": "", 72 | "cmake": "", 73 | "cmd": "", 74 | "coffee": "", 75 | "com": "", 76 | "conda": "", 77 | "conf": "", 78 | "config": "", 79 | "cow": "󰆚", 80 | "cp": "", 81 | "cpio": "", 82 | "cpp": "", 83 | "cr": "", 84 | "cr2": "", 85 | "crdownload": "󰇚", 86 | "crt": "", 87 | "cs": "󰌛", 88 | "csh": "", 89 | "cshtml": "", 90 | "csproj": "󰌛", 91 | "css": "", 92 | "csv": "", 93 | "csx": "󰌛", 94 | "cts": "", 95 | "cu": "", 96 | "cue": "󰲹", 97 | "cuh": "", 98 | "cxx": "", 99 | "d": "", 100 | "dart": "", 101 | "db": "", 102 | "db3": "", 103 | "dconf": "", 104 | "deb": "", 105 | "desktop": "", 106 | "di": "", 107 | "diff": "", 108 | "djv": "", 109 | "djvu": "", 110 | "dll": "", 111 | "dmg": "", 112 | "doc": "", 113 | "dockerfile": "", 114 | "dockerignore": "", 115 | "docm": "", 116 | "docx": "", 117 | "dot": "󱁉", 118 | "download": "󰇚", 119 | "drawio": "", 120 | "dump": "", 121 | "dvi": "", 122 | "dwg": "󰻫", 123 | "dxf": "󰻫", 124 | "dylib": "", 125 | "ebook": "", 126 | "ebuild": "", 127 | "edn": "", 128 | "eex": "", 129 | "ejs": "", 130 | "el": "", 131 | "elc": "", 132 | "elf": "", 133 | "elm": "", 134 | "eml": "", 135 | "env": "", 136 | "eot": "", 137 | "eps": "󰕙", 138 | "epub": "", 139 | "erb": "", 140 | "erl": "", 141 | "ex": "", 142 | "exe": "", 143 | "exs": "", 144 | "f": "󱈚", 145 | "f#": "", 146 | "f3d": "󰻫", 147 | "f3z": "󰻫", 148 | "f90": "󱈚", 149 | "fbx": "󰆧", 150 | "fcbak": "", 151 | "fcmacro": "", 152 | "fcmat": "", 153 | "fcparam": "", 154 | "fcscript": "", 155 | "fcstd": "", 156 | "fcstd1": "", 157 | "fctb": "", 158 | "fctl": "", 159 | "fdmdownload": "󰇚", 160 | "fish": "", 161 | "flac": "", 162 | "flc": "", 163 | "flf": "", 164 | "flv": "", 165 | "fnl": "", 166 | "fnt": "", 167 | "fodg": "", 168 | "fodp": "", 169 | "fods": "", 170 | "fodt": "", 171 | "fon": "", 172 | "font": "", 173 | "for": "󱈚", 174 | "fs": "", 175 | "fsi": "", 176 | "fsproj": "", 177 | "fsscript": "", 178 | "fsx": "", 179 | "gba": "󱎓", 180 | "gbl": "", 181 | "gbo": "", 182 | "gbp": "", 183 | "gbr": "", 184 | "gbs": "", 185 | "gcode": "󰫴", 186 | "gd": "", 187 | "gdoc": "", 188 | "gem": "", 189 | "gemfile": "", 190 | "gemspec": "", 191 | "gform": "", 192 | "gif": "", 193 | "git": "", 194 | "gleam": "󰦥", 195 | "gm1": "", 196 | "gml": "", 197 | "go": "", 198 | "godot": "", 199 | "gpg": "󰦝", 200 | "gql": "", 201 | "gradle": "", 202 | "graphql": "", 203 | "gresource": "", 204 | "groovy": "", 205 | "gsheet": "", 206 | "gslides": "", 207 | "gtl": "", 208 | "gto": "", 209 | "gtp": "", 210 | "gts": "", 211 | "guardfile": "", 212 | "gv": "󱁉", 213 | "gvy": "", 214 | "gz": "", 215 | "h": "", 216 | "h++": "", 217 | "h264": "", 218 | "haml": "", 219 | "hbs": "", 220 | "hc": "󰂢", 221 | "heic": "", 222 | "heics": "", 223 | "heif": "", 224 | "hex": "󱊧", 225 | "hh": "", 226 | "hpp": "", 227 | "hrl": "", 228 | "hs": "", 229 | "htm": "", 230 | "html": "", 231 | "hxx": "", 232 | "iam": "󰻫", 233 | "ical": "", 234 | "icalendar": "", 235 | "ico": "", 236 | "ics": "", 237 | "ifb": "", 238 | "ifc": "󰻫", 239 | "ige": "󰻫", 240 | "iges": "󰻫", 241 | "igs": "󰻫", 242 | "image": "", 243 | "img": "", 244 | "iml": "", 245 | "info": "", 246 | "ini": "", 247 | "inl": "", 248 | "ino": "", 249 | "ipt": "󰻫", 250 | "ipynb": "", 251 | "iso": "", 252 | "j2c": "", 253 | "j2k": "", 254 | "jad": "", 255 | "jar": "", 256 | "java": "", 257 | "jfi": "", 258 | "jfif": "", 259 | "jif": "", 260 | "jl": "", 261 | "jmd": "", 262 | "jp2": "", 263 | "jpe": "", 264 | "jpeg": "", 265 | "jpf": "", 266 | "jpg": "", 267 | "jpx": "", 268 | "js": "", 269 | "json": "", 270 | "json5": "", 271 | "jsonc": "", 272 | "jsx": "", 273 | "jwmrc": "", 274 | "jxl": "", 275 | "kbx": "󰯄", 276 | "kdb": "", 277 | "kdbx": "", 278 | "kdenlive": "", 279 | "kdenlivetitle": "", 280 | "key": "", 281 | "kicad_dru": "", 282 | "kicad_mod": "", 283 | "kicad_pcb": "", 284 | "kicad_prl": "", 285 | "kicad_pro": "", 286 | "kicad_sch": "", 287 | "kicad_sym": "", 288 | "kicad_wks": "", 289 | "ko": "", 290 | "kpp": "", 291 | "kra": "", 292 | "krz": "", 293 | "ksh": "", 294 | "kt": "", 295 | "kts": "", 296 | "latex": "", 297 | "lbr": "", 298 | "lck": "", 299 | "ldb": "", 300 | "leex": "", 301 | "less": "", 302 | "lff": "", 303 | "lhs": "", 304 | "lib": "", 305 | "license": "", 306 | "lisp": "󰅲", 307 | "localized": "", 308 | "lock": "", 309 | "log": "", 310 | "lpp": "", 311 | "lrc": "󰨖", 312 | "ltx": "", 313 | "lua": "", 314 | "luac": "", 315 | "luau": "", 316 | "lz": "", 317 | "lz4": "", 318 | "lzh": "", 319 | "lzma": "", 320 | "lzo": "", 321 | "m": "", 322 | "m2ts": "", 323 | "m2v": "", 324 | "m3u": "󰲹", 325 | "m3u8": "󰲹", 326 | "m4a": "", 327 | "m4v": "", 328 | "magnet": "", 329 | "markdown": "", 330 | "md": "", 331 | "md5": "󰕥", 332 | "mdb": "", 333 | "mdx": "", 334 | "mid": "󰣲", 335 | "mjs": "", 336 | "mk": "", 337 | "mka": "", 338 | "mkd": "", 339 | "mkv": "", 340 | "ml": "", 341 | "mli": "", 342 | "mll": "", 343 | "mly": "", 344 | "mm": "", 345 | "mo": "󰗊", 346 | "mobi": "", 347 | "mov": "", 348 | "mp2": "", 349 | "mp3": "", 350 | "mp4": "", 351 | "mpeg": "", 352 | "mpg": "", 353 | "msf": "", 354 | "msi": "", 355 | "mts": "", 356 | "mustache": "", 357 | "nef": "", 358 | "nfo": "", 359 | "nim": "", 360 | "nimble": "", 361 | "nims": "", 362 | "ninja": "󰝴", 363 | "nix": "", 364 | "node": "", 365 | "nsp": "󰟡", 366 | "nu": "", 367 | "o": "", 368 | "obj": "󰆧", 369 | "odb": "", 370 | "odf": "", 371 | "odg": "", 372 | "odp": "", 373 | "ods": "", 374 | "odt": "", 375 | "ogg": "", 376 | "ogm": "", 377 | "ogv": "", 378 | "opml": "󰗀", 379 | "opus": "", 380 | "orf": "", 381 | "org": "", 382 | "otf": "", 383 | "out": "", 384 | "p12": "", 385 | "par": "", 386 | "part": "󰇚", 387 | "patch": "", 388 | "pbm": "", 389 | "pcbdoc": "", 390 | "pcm": "", 391 | "pdf": "", 392 | "pem": "", 393 | "pfx": "", 394 | "pgm": "", 395 | "phar": "", 396 | "php": "", 397 | "pkg": "", 398 | "pl": "", 399 | "plist": "", 400 | "pls": "󰲹", 401 | "plx": "", 402 | "ply": "󰆧", 403 | "pm": "", 404 | "png": "", 405 | "pnm": "", 406 | "po": "󰗊", 407 | "pod": "", 408 | "pot": "󰗊", 409 | "pp": "", 410 | "ppm": "", 411 | "pps": "", 412 | "ppsx": "", 413 | "ppt": "", 414 | "pptx": "", 415 | "prjpcb": "", 416 | "procfile": "", 417 | "properties": "", 418 | "prql": "", 419 | "ps": "󰕙", 420 | "ps1": "", 421 | "psb": "", 422 | "psd": "", 423 | "psd1": "", 424 | "psf": "", 425 | "psm": "󰻫", 426 | "psm1": "", 427 | "pub": "󰷖", 428 | "purs": "", 429 | "pxd": "", 430 | "pxm": "", 431 | "py": "", 432 | "pyc": "", 433 | "pyd": "", 434 | "pyi": "", 435 | "pyo": "", 436 | "pyw": "", 437 | "pyx": "", 438 | "qcow": "", 439 | "qcow2": "", 440 | "qm": "󰗊", 441 | "qml": "", 442 | "qrc": "", 443 | "qss": "", 444 | "r": "", 445 | "rake": "", 446 | "rakefile": "", 447 | "rar": "", 448 | "raw": "", 449 | "razor": "", 450 | "rb": "", 451 | "rdata": "", 452 | "rdb": "", 453 | "rdoc": "", 454 | "rds": "", 455 | "readme": "󰂺", 456 | "rkt": "", 457 | "rlib": "", 458 | "rmd": "", 459 | "rmeta": "", 460 | "rpm": "", 461 | "rs": "", 462 | "rspec": "", 463 | "rspec_parallel": "", 464 | "rspec_status": "", 465 | "rss": "", 466 | "rst": "", 467 | "rtf": "", 468 | "ru": "", 469 | "rubydoc": "", 470 | "s": "", 471 | "s3db": "", 472 | "sal": "󱑻", 473 | "sass": "", 474 | "sbt": "󰨖", 475 | "scad": "", 476 | "scala": "", 477 | "sch": "󰭅", 478 | "schdoc": "󰭅", 479 | "scm": "", 480 | "scss": "", 481 | "service": "", 482 | "sf2": "󰽰", 483 | "sfz": "󰽰", 484 | "sh": "", 485 | "sha1": "󰕥", 486 | "sha224": "󰕥", 487 | "sha256": "󰕥", 488 | "sha384": "󰕥", 489 | "sha512": "󰕥", 490 | "shell": "", 491 | "shtml": "", 492 | "sig": "󱧃", 493 | "signature": "󱧃", 494 | "skp": "󰻫", 495 | "sl3": "", 496 | "sld": "", 497 | "sldasm": "󰻫", 498 | "sldprt": "󰻫", 499 | "slim": "", 500 | "sln": "", 501 | "slvs": "󰻫", 502 | "so": "", 503 | "sql": "", 504 | "sqlite": "", 505 | "sqlite3": "", 506 | "sr": "󱑻", 507 | "srt": "󰨖", 508 | "ss": "", 509 | "ssa": "󰨖", 510 | "ste": "󰻫", 511 | "step": "󰻫", 512 | "stl": "󰆧", 513 | "stp": "󰻫", 514 | "sty": "", 515 | "styl": "", 516 | "stylus": "", 517 | "sub": "󰨖", 518 | "sublime-build": "", 519 | "sublime-keymap": "", 520 | "sublime-menu": "", 521 | "sublime-options": "", 522 | "sublime-package": "", 523 | "sublime-project": "", 524 | "sublime-session": "", 525 | "sublime-settings": "", 526 | "sublime-snippet": "", 527 | "sublime-theme": "", 528 | "suo": "", 529 | "sv": "󰍛", 530 | "svelte": "", 531 | "svg": "󰕙", 532 | "svh": "󰍛", 533 | "swf": "", 534 | "swift": "", 535 | "t": "", 536 | "tape": "󰨛", 537 | "tar": "", 538 | "taz": "", 539 | "tbc": "󰛓", 540 | "tbz": "", 541 | "tbz2": "", 542 | "tc": "", 543 | "tcl": "󰛓", 544 | "tex": "", 545 | "tf": "󱁢", 546 | "tfstate": "󱁢", 547 | "tfvars": "󱁢", 548 | "tgz": "", 549 | "tif": "", 550 | "tiff": "", 551 | "tlz": "", 552 | "tml": "", 553 | "tmux": "", 554 | "toml": "", 555 | "torrent": "", 556 | "tres": "", 557 | "ts": "", 558 | "tscn": "", 559 | "tsv": "", 560 | "tsx": "", 561 | "ttc": "", 562 | "ttf": "", 563 | "twig": "", 564 | "txt": "", 565 | "txz": "", 566 | "typ": "𝐭", 567 | "tz": "", 568 | "tzo": "", 569 | "ui": "", 570 | "unity": "", 571 | "unity3d": "", 572 | "v": "", 573 | "vala": "", 574 | "vdi": "", 575 | "vhd": "", 576 | "vhdl": "󰍛", 577 | "vhs": "󰨛", 578 | "vi": "", 579 | "video": "", 580 | "vim": "", 581 | "vmdk": "", 582 | "vob": "", 583 | "vsix": "󰨞", 584 | "vue": "󰡄", 585 | "war": "", 586 | "wav": "", 587 | "webm": "", 588 | "webmanifest": "", 589 | "webp": "", 590 | "whl": "", 591 | "windows": "", 592 | "wma": "", 593 | "wmv": "", 594 | "woff": "", 595 | "woff2": "", 596 | "wrl": "󰆧", 597 | "wrz": "󰆧", 598 | "wv": "", 599 | "x_b": "󰻫", 600 | "x_t": "󰻫", 601 | "xaml": "󰙳", 602 | "xcf": "", 603 | "xci": "󰟡", 604 | "xcplayground": "", 605 | "xhtml": "", 606 | "xlr": "", 607 | "xls": "", 608 | "xlsm": "", 609 | "xlsx": "", 610 | "xml": "󰗀", 611 | "xpi": "", 612 | "xpm": "", 613 | "xul": "󰗀", 614 | "xz": "", 615 | "yaml": "", 616 | "yml": "", 617 | "z": "", 618 | "z64": "󱎓", 619 | "zig": "", 620 | "zip": "", 621 | "zsh": "", 622 | "zsh-theme": "󱆃", 623 | "zst": "" 624 | } 625 | -------------------------------------------------------------------------------- /assets/json/fileformat.json: -------------------------------------------------------------------------------- 1 | { 2 | "dos": "", 3 | "mac": "", 4 | "unix": "" 5 | } 6 | -------------------------------------------------------------------------------- /assets/json/pattern.json: -------------------------------------------------------------------------------- 1 | { 2 | ".*\\.d\\.ts$": "", 3 | ".*angular.*\\.js$": "", 4 | ".*backbone.*\\.js$": "", 5 | ".*jquery.*\\.js$": "", 6 | ".*materialize.*\\.css$": "", 7 | ".*materialize.*\\.js$": "", 8 | ".*mootools.*\\.js$": "", 9 | ".*require.*\\.js$": "", 10 | ".*vimrc.*": "", 11 | "/Contacts\\.$": "󰉌", 12 | "/Desktop\\.$": "", 13 | "/Downloads\\.$": "󰉍", 14 | "/Favorites\\.$": "󰚝", 15 | "/Mail\\.$": "󰇰", 16 | "/Movies\\.$": "󰿎", 17 | "/Music\\.$": "󱍙", 18 | "/Pictures\\.$": "󰉏", 19 | "/Trash.$": "", 20 | "/Users.$": "", 21 | "/Videos\\.$": "", 22 | "/\\.Trash-\\d\\+.$": "", 23 | "/\\.Trash.$": "", 24 | "/\\.\\?yarnrc\\(\\.ya\\?ml\\)\\?$": "", 25 | "/\\.atom.$": "", 26 | "/\\.config.$": "", 27 | "/\\.env\\(\\.[A-z0-9]\\+\\)*$": "", 28 | "/\\.eslintrc\\(\\.\\(c\\?js\\|ya\\?ml\\|json\\)\\)\\?$": "󰱺", 29 | "/\\.git.$": "", 30 | "/\\.github.$": "", 31 | "/\\.idea.$": "", 32 | "/\\.npm.$": "", 33 | "/\\.prettierrc\\(\\.\\(json5\\?\\|c\\?js\\|ya\\?ml\\|toml\\)\\)\\?": "󰏣", 34 | "/\\.ssh.$": "󰢬", 35 | "/\\.vscode.$": "", 36 | "/\\cloudbuild\\.ya\\?ml$": "󱇶", 37 | "/bin.$": "", 38 | "/cabal\\.$": "", 39 | "/codecov\\.ya\\?ml": "", 40 | "/config\\.$": "", 41 | "/cron\\.d.$": "", 42 | "/cron\\.daily.$": "", 43 | "/cron\\.hourly.$": "", 44 | "/cron\\.minutely.$": "", 45 | "/cron\\.monthly.$": "", 46 | "/cron\\.weekly.$": "", 47 | "/eslint\\.config\\.js?$": "󰱺", 48 | "/etc\\.$": "", 49 | "/hi\\.$": "", 50 | "/hidden\\.$": "󱞞", 51 | "/home.$": "", 52 | "/home\\.$": "󱂵", 53 | "/include.$": "", 54 | "/include\\.$": "", 55 | "/lib.$": "", 56 | "/lib32.$": "", 57 | "/lib64.$": "", 58 | "/libexec.$": "", 59 | "/node_modules.$": "", 60 | "/node_modules\\.$": "", 61 | "/npm_cache\\.$": "", 62 | "/pam\\.d.$": "󰢬", 63 | "/prettier\\.config\\.c\\?js?$": "󰏣", 64 | "/sbin.$": "", 65 | "/ssh\\.$": "󰢬", 66 | "/sudoers\\.d.$": "󰢬", 67 | "/xbin.$": "", 68 | "/xbps\\.d.$": "", 69 | "/xorg\\.conf.d.$": "", 70 | "Vagrantfile$": "" 71 | } 72 | -------------------------------------------------------------------------------- /assets/json/platform.json: -------------------------------------------------------------------------------- 1 | { 2 | "alpine": "", 3 | "amzn": "", 4 | "android": "", 5 | "aosc": "", 6 | "arch": "", 7 | "artix": "", 8 | "centos": "", 9 | "coreos": "", 10 | "debian": "", 11 | "devuan": "", 12 | "docker": "", 13 | "elementary": "", 14 | "endeavouros": "", 15 | "fedora": "", 16 | "freebsd": "", 17 | "gentoo": "", 18 | "guix": "", 19 | "kali": "", 20 | "linux": "", 21 | "macos": "", 22 | "mageia": "", 23 | "manjaro": "", 24 | "mint": "", 25 | "nixos": "", 26 | "opensuse": "", 27 | "raspbian": "", 28 | "rhel": "", 29 | "rocky": "", 30 | "sabayon": "", 31 | "slackware": "", 32 | "sunos": "", 33 | "ubuntu": "", 34 | "void": "", 35 | "windows": "" 36 | } 37 | -------------------------------------------------------------------------------- /autoload/nerdfont.vim: -------------------------------------------------------------------------------- 1 | scriptencoding utf-8 2 | 3 | let s:path = fnamemodify(resolve(expand(':p')), ':h:h') 4 | let s:sep = has('win32') ? '\' : '/' 5 | let s:json_dir = join([s:path, 'assets', 'json'], s:sep) 6 | 7 | function! nerdfont#get_json(json_name) abort 8 | let l:json = join([s:json_dir, a:json_name . '.json'], s:sep) 9 | let l:result = json_decode(join(readfile(l:json), '')) 10 | call s:autofix(l:result) 11 | return l:result 12 | endfunction 13 | 14 | function! nerdfont#find(...) abort 15 | let path = a:0 > 0 ? a:1 : bufname('%') 16 | let isdir = a:0 > 1 ? a:2 : 'auto' 17 | 18 | let glyph = nerdfont#path#pattern#find(path) 19 | if !empty(glyph) 20 | return glyph 21 | endif 22 | 23 | let glyph = nerdfont#path#basename#find(path) 24 | if !empty(glyph) 25 | return glyph 26 | endif 27 | 28 | let isdir = isdir ==# 'auto' ? isdirectory(path) : isdir 29 | if !empty(isdir) 30 | return nerdfont#directory#find(type(isdir) is# v:t_string ? isdir : '') 31 | endif 32 | 33 | let glyph = nerdfont#path#extension#find(path) 34 | if !empty(glyph) 35 | return glyph 36 | endif 37 | 38 | return g:nerdfont#default 39 | endfunction 40 | 41 | function! s:autofix(result) abort 42 | if exists('*setcellwidths') && get(g:, 'nerdfont#autofix_cellwidths', 0) 43 | try 44 | let l:code_points = map(values(a:result), {_, v -> char2nr(v)}) 45 | let l:code_points = filter(l:code_points, {_, v -> v > 0x80}) 46 | call nerdfont#cellwidths#fix(l:code_points) 47 | catch 48 | echohl WarningMsg 49 | echo '[nerdfont]: Failed to fix cellwidths of nerd font glyphs.' 50 | echo '[nerdfont]: Disable this autofix feature by setting `g:nerdfont#autofix_cellwidths` to 0.' 51 | echohl None 52 | let g:nerdfont#autofix_cellwidths = 0 53 | endtry 54 | endif 55 | endfunction 56 | 57 | let g:nerdfont#default = get(g:, 'nerdfont#default', '') 58 | -------------------------------------------------------------------------------- /autoload/nerdfont/cellwidths.vim: -------------------------------------------------------------------------------- 1 | function! nerdfont#cellwidths#fix(code_points) abort 2 | let l:values = map(a:code_points, {_, v -> type(v) is# v:t_list ? v : [v, v]}) 3 | let l:list = map(l:values, {_, v -> type(v) is# v:t_list ? v + [2] : [v, v, 2]}) 4 | let l:list = s:norm(l:list + getcellwidths()) 5 | call setcellwidths(l:list) 6 | endfunction 7 | 8 | function! s:compare(lhs, rhs) abort 9 | return a:lhs[0] == a:rhs[0] 10 | \ ? a:lhs[1] == a:rhs[1] 11 | \ ? 0 12 | \ : a:lhs[1] < a:rhs[1] 13 | \ ? -1 14 | \ : 1 15 | \ : a:lhs[0] < a:rhs[0] 16 | \ ? -1 17 | \ : 1 18 | endfunction 19 | 20 | function! s:norm(ranges) abort 21 | call uniq(sort(a:ranges, 's:compare'), 's:compare') 22 | let l:oldvalues = a:ranges 23 | let l:newvalues = [a:ranges[0]] 24 | let l:oldsize = len(l:oldvalues) 25 | let l:newsize = len(l:newvalues) 26 | let l:retries = 0 27 | while l:oldsize != l:newsize || l:retries < 5 28 | for l:idx in range(len(l:oldvalues)) 29 | let l:lhs = remove(l:newvalues, -1) 30 | let l:rhs = l:oldvalues[l:idx] 31 | call extend(l:newvalues, s:merge(l:lhs, l:rhs)) 32 | endfor 33 | call uniq(sort(l:newvalues, 's:compare'), 's:compare') 34 | let l:oldsize = len(l:oldvalues) 35 | let l:newsize = len(l:newvalues) 36 | let l:oldvalues = l:newvalues 37 | let l:retries += 1 38 | endwhile 39 | return l:oldvalues 40 | endfunction 41 | 42 | function! s:merge(a, b) abort 43 | if a:a[2] != a:b[2] 44 | return [a:a, a:b] 45 | elseif a:a[0] <= a:b[0] && a:b[1] <= a:a[1] 46 | " a: ------------- 47 | " b: ------ 48 | return [[a:a[0], a:a[1], a:a[2]]] 49 | elseif a:b[0] <= a:a[0] && a:a[1] <= a:b[1] 50 | " a: ------ 51 | " b: ------------- 52 | return [[a:b[0], a:b[1], a:a[2]]] 53 | elseif a:a[0] <= a:b[0] && a:b[0] <= a:a[1] 54 | " a: -------- 55 | " b: ------ 56 | return [[a:a[0], max([a:a[1], a:b[1]]), a:a[2]]] 57 | elseif a:b[0] <= a:a[0] && a:a[0] <= a:b[1] 58 | " a: ------ 59 | " b: -------- 60 | return [[a:b[0], max([a:a[1], a:b[1]]), a:a[2]]] 61 | endif 62 | return [a:a, a:b] 63 | endfunction 64 | -------------------------------------------------------------------------------- /autoload/nerdfont/directory.vim: -------------------------------------------------------------------------------- 1 | let g:nerdfont#directory#customs = get(g:, 'nerdfont#directory#customs', {}) 2 | let g:nerdfont#directory#defaults = nerdfont#get_json('directory') 3 | 4 | function! nerdfont#directory#find(...) abort 5 | let n = a:0 ? a:1 : '.' 6 | return get(s:m, n, '') 7 | endfunction 8 | 9 | function! nerdfont#directory#refresh() abort 10 | let s:m = extend( 11 | \ copy(g:nerdfont#directory#defaults), 12 | \ g:nerdfont#directory#customs, 13 | \) 14 | endfunction 15 | 16 | call nerdfont#directory#refresh() 17 | -------------------------------------------------------------------------------- /autoload/nerdfont/fileformat.vim: -------------------------------------------------------------------------------- 1 | let g:nerdfont#fileformat#customs = get(g:, 'nerdfont#fileformat#customs', {}) 2 | let g:nerdfont#fileformat#defaults = nerdfont#get_json('fileformat') 3 | 4 | function! nerdfont#fileformat#find(...) abort 5 | let n = a:0 ? a:1 : &fileformat 6 | return get(s:m, n, '') 7 | endfunction 8 | 9 | function! nerdfont#fileformat#refresh() abort 10 | let s:m = extend( 11 | \ copy(g:nerdfont#fileformat#defaults), 12 | \ g:nerdfont#fileformat#customs, 13 | \) 14 | endfunction 15 | 16 | call nerdfont#fileformat#refresh() 17 | -------------------------------------------------------------------------------- /autoload/nerdfont/path/basename.vim: -------------------------------------------------------------------------------- 1 | let g:nerdfont#path#basename#customs = get(g:, 'nerdfont#path#basename#customs', {}) 2 | let g:nerdfont#path#basename#defaults = nerdfont#get_json('basename') 3 | 4 | function! nerdfont#path#basename#find(path) abort 5 | let n = tolower(fnamemodify(a:path, ':t')) 6 | return get(s:m, n, '') 7 | endfunction 8 | 9 | function! nerdfont#path#basename#refresh() abort 10 | let s:m = extend( 11 | \ copy(g:nerdfont#path#basename#defaults), 12 | \ g:nerdfont#path#basename#customs, 13 | \) 14 | endfunction 15 | 16 | call nerdfont#path#basename#refresh() 17 | -------------------------------------------------------------------------------- /autoload/nerdfont/path/extension.vim: -------------------------------------------------------------------------------- 1 | let g:nerdfont#path#extension#customs = get(g:, 'nerdfont#path#extension#customs', {}) 2 | let g:nerdfont#path#extension#defaults = nerdfont#get_json('extension') 3 | 4 | function! nerdfont#path#extension#find(path) abort 5 | let n = tolower(fnamemodify(a:path, ':e')) 6 | return get(s:m, n, '') 7 | endfunction 8 | 9 | function! nerdfont#path#extension#refresh() abort 10 | let s:m = extend( 11 | \ copy(g:nerdfont#path#extension#defaults), 12 | \ g:nerdfont#path#extension#customs, 13 | \) 14 | endfunction 15 | 16 | call nerdfont#path#extension#refresh() 17 | -------------------------------------------------------------------------------- /autoload/nerdfont/path/pattern.vim: -------------------------------------------------------------------------------- 1 | let g:nerdfont#path#pattern#customs = get(g:, 'nerdfont#path#pattern#customs', {}) 2 | let g:nerdfont#path#pattern#defaults = nerdfont#get_json('pattern') 3 | 4 | function! nerdfont#path#pattern#find(path) abort 5 | for [k, v] in s:m 6 | if a:path =~# '\m' . k 7 | return v 8 | endif 9 | endfor 10 | return '' 11 | endfunction 12 | 13 | function! nerdfont#path#pattern#refresh() abort 14 | let s:m = items(extend( 15 | \ copy(g:nerdfont#path#pattern#defaults), 16 | \ g:nerdfont#path#pattern#customs, 17 | \)) 18 | endfunction 19 | 20 | call nerdfont#path#pattern#refresh() 21 | -------------------------------------------------------------------------------- /autoload/nerdfont/platform.vim: -------------------------------------------------------------------------------- 1 | let g:nerdfont#platform#customs = get(g:, 'nerdfont#platform#customs', {}) 2 | let g:nerdfont#platform#defaults = nerdfont#get_json('platform') 3 | 4 | function! nerdfont#platform#find(...) abort 5 | let n = a:0 ? a:1 : s:find_platform() 6 | return get(s:m, n, '') 7 | endfunction 8 | 9 | "" 10 | " https://github.com/romkatv/powerlevel10k/blob/master/internal/wizard.zsh 11 | " refer `os_icon_name()` 12 | function! s:find_platform() abort 13 | if exists('s:platform') 14 | return s:platform 15 | endif 16 | if has('win32') 17 | let s:platform = 'windows' 18 | return s:platform 19 | endif 20 | if has('mac') || has('macunix') 21 | let s:platform = 'macos' 22 | return s:platform 23 | endif 24 | if has('sun') 25 | let s:platform = 'sunos' 26 | return s:platform 27 | endif 28 | if has('bsd') 29 | let s:platform = 'freebsd' 30 | return s:platform 31 | endif 32 | " https://wiki.termux.com/wiki/Differences_from_Linux 33 | if $PREFIX ==# '/data/data/com.termux/files/usr' 34 | let s:platform = 'android' 35 | return s:platform 36 | endif 37 | if filereadable('/etc/artix-release') 38 | let s:platform = 'artix' 39 | return s:platform 40 | endif 41 | let s:platform = s:find_distro() 42 | return s:platform 43 | endfunction 44 | 45 | function! s:find_distro() abort 46 | let filename = '/etc/os-release' 47 | if !filereadable(filename) 48 | let filename = '/usr/lib/os-release' 49 | endif 50 | if filereadable(filename) 51 | let result = '' 52 | for line in readfile(filename) 53 | if line =~# '^ID=' 54 | let result = substitute(line, '^ID=', '', '') 55 | break 56 | endif 57 | endfor 58 | if result =~# 'arch' 59 | return 'arch' 60 | elseif result =~# 'debian' 61 | return 'debian' 62 | elseif result =~# 'raspbian' 63 | return 'raspbian' 64 | elseif result =~# 'ubuntu' 65 | return 'ubuntu' 66 | elseif result =~# 'elementary' 67 | return 'elementary' 68 | elseif result =~# 'fedora' 69 | return 'fedora' 70 | elseif result =~# 'coreos' 71 | return 'coreos' 72 | elseif result =~# 'kali' 73 | return 'kali' 74 | elseif result =~# 'gentoo' 75 | return 'gentoo' 76 | elseif result =~# 'mageia' 77 | return 'mageia' 78 | elseif result =~# 'centos' 79 | return 'centos' 80 | elseif result =~# 'opensuse' 81 | return 'opensuse' 82 | elseif result =~# 'tumbleweed' 83 | return 'opensuse' 84 | elseif result =~# 'sabayon' 85 | return 'sabayon' 86 | elseif result =~# 'slackware' 87 | return 'slackware' 88 | elseif result =~# 'linuxmint' 89 | return 'mint' 90 | elseif result =~# 'alpine' 91 | return 'alpine' 92 | elseif result =~# 'aosc' 93 | return 'aosc' 94 | elseif result =~# 'nixos' 95 | return 'nixos' 96 | elseif result =~# 'devuan' 97 | return 'devuan' 98 | elseif result =~# 'manjaro' 99 | return 'manjaro' 100 | elseif result =~# 'void' 101 | return 'void' 102 | elseif result =~# 'artix' 103 | return 'artix' 104 | elseif result =~# 'rhel' 105 | return 'rhel' 106 | elseif result =~# 'amzn' 107 | return 'amzn' 108 | elseif result =~# 'endeavouros' 109 | return 'endeavouros' 110 | elseif result =~# 'rocky' 111 | return 'rocky' 112 | elseif result =~# 'guix' 113 | return 'guix' 114 | elseif result =~# 'dock' 115 | return 'docker' 116 | endif 117 | return 'linux' 118 | endfunction 119 | 120 | function! nerdfont#platform#refresh() abort 121 | let s:m = extend( 122 | \ copy(g:nerdfont#platform#defaults), 123 | \ g:nerdfont#platform#customs, 124 | \) 125 | endfunction 126 | 127 | call nerdfont#platform#refresh() 128 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | tags 2 | -------------------------------------------------------------------------------- /doc/nerdfont.txt: -------------------------------------------------------------------------------- 1 | *nerdfont.txt* A plugin to handle Nerd Fonts 2 | 3 | Author: Alisue 4 | License: MIT license 5 | 6 | ============================================================================= 7 | CONTENTS *nerdfont-contents* 8 | 9 | INTRODUCTION |nerdfont-introduction| 10 | USAGE |nerdfont-usage| 11 | INTERFACE |nerdfont-interface| 12 | VARIABLE |nerdfont-variable| 13 | FUNCTION |nerdfont-function| 14 | 15 | 16 | ============================================================================= 17 | INTRODUCTION *nerdfont-introduction* 18 | 19 | *nerdfont.vim* (nerdfont) is a plugin to handle Nerd Fonts [1]. 20 | It is like a simplified version of vim-devicons [2]. It does not provide any 21 | 3rd party integrations in itself. Any 3rd party integrations will be released 22 | as cooperate plugins. 23 | 24 | [1] https://github.com/ryanoasis/nerd-fonts 25 | [2] https://github.com/ryanoasis/vim-devicons 26 | 27 | Most of glyph mappings has copied from vim-devicons. 28 | 29 | 30 | ============================================================================= 31 | USAGE *nerdfont-usage* 32 | 33 | Use |nerdfont#find()| function to find a filetype glyph of a current buffer 34 | like WebDevIconsGetFileTypeSymbol() function in vim-devicons. 35 | 36 | Use |nerdfont#fileformat#find()| function to find fileformat of a current 37 | buffer like WebDevIconsGetFileFormatSymbol() function in vim-devicons. 38 | 39 | Users can use above functions to show current status in 'statusline' like: 40 | > 41 | set statusline=%f\ %{nerdfont#find()}\ %{nerdfont#fileformat#find()} 42 | < 43 | See |nerdfont-function| for more details. 44 | 45 | 46 | ============================================================================= 47 | INTERFACE *nerdfont-interface* 48 | 49 | ----------------------------------------------------------------------------- 50 | VARIABLE *nerdfont-variable* 51 | 52 | *g:nerdfont#default* 53 | A default glyph. 54 | > 55 | let g:nerdfont#default = 'glyph for default path' 56 | < 57 | *g:nerdfont#autofix_cellwidths* 58 | Automatically set cellwidth of nerdfont glyphs to 2. Try to enable it 59 | if you faced font width issue. 60 | > 61 | let g:nerdfont#autofix_cellwidths = 1 62 | < 63 | *g:nerdfont#directory#customs* 64 | A custom glyph mappings for directory. 65 | > 66 | let g:nerdfont#directory#customs = { 67 | \ '': 'glyph for default directory', 68 | \ 'open': 'glyph for open directory', 69 | \ 'close': 'glyph for close directory', 70 | \ 'symlink': 'glyph for symlink directory', 71 | \} 72 | < 73 | *g:nerdfont#fileformat#customs* 74 | A custom glyph mappings for fileformat. 75 | > 76 | let g:nerdfont#fileformat#customs = { 77 | \ 'dos': 'glyph for dos', 78 | \ 'mac': 'glyph for mac', 79 | \ 'unix': 'glyph for unix', 80 | \} 81 | < 82 | *g:nerdfont#platform#customs* 83 | A custom glyph mappings for platform. 84 | > 85 | let g:nerdfont#platform#customs = { 86 | \ 'windows': 'glyph for Windows', 87 | \ 'macos': 'glyph for macOS', 88 | \ 'linux': 'glyph for Linux', 89 | \ 'arch': 'glyph for Arch Linux', 90 | \ 'ubuntu': 'glyph for Ubuntu', 91 | \ 'debian': 'glyph for Debian', 92 | \ 'centos': 'glyph for CentOS', 93 | \ 'docker': 'glyph for Docker', 94 | \} 95 | < 96 | *g:nerdfont#path#basename#customs* 97 | A custom glyph mappings for basename match. 98 | > 99 | let g:nerdfont#path#basename#customs = { 100 | \ 'dockerfile': 'glyph for dockerfile', 101 | \ 'Makefile': 'glyph for Makefile', 102 | \} 103 | < 104 | *g:nerdfont#path#extension#customs* 105 | A custom glyph mappings for extension match. 106 | > 107 | let g:nerdfont#path#extension#customs = { 108 | \ 'js': 'glyph for .js', 109 | \ 'rb': 'glyph for .rb', 110 | \} 111 | < 112 | *g:nerdfont#path#pattern#customs* 113 | A custom glyph mappings for pattern match. 114 | > 115 | let g:nerdfont#path#pattern#customs = { 116 | \ '.*/dockerfiles/[^.]*$': 'glyph for files under dockerfiles', 117 | \} 118 | < 119 | ----------------------------------------------------------------------------- 120 | FUNCTION *nerdfont-function* 121 | 122 | *nerdfont#find()* 123 | nerdfont#find([{path}][, {isdir}]) 124 | Return a glyph (|String|) of a given {path} (|String|). 125 | 126 | It sequentically tries following functions and fallback to 127 | |g:nerdfont#default| to find a suitable glyph. 128 | 129 | 1. |nerdfont#path#pattern#find()| 130 | 2. |nerdfont#path#basename#find()| 131 | 3. |nerdfont#directory#find()| if {isdir} is truthy value 132 | 4. |nerdfont#path#extension#find()| if {isdir} is falsy value 133 | 134 | When {isdir} is omitted or "auto", |isdirectory()| function is used to 135 | determine if the given {path} is directory or not prior to step 3. 136 | When {isdir} is non empty |String|, the value is passed to the 137 | |nerdfont#directory#find()| as a {state} of a directory. 138 | When {path} is omitted, a name of the current buffer is used. 139 | 140 | For example: 141 | > 142 | echo nerdfont#find() 143 | "  144 | echo nerdfont#find('hello.rb') 145 | "  146 | echo nerdfont#find('hello', 1) 147 | "  148 | echo nerdfont#find('hello', 'open') 149 | "  150 | < 151 | *nerdfont#directory#find()* 152 | nerdfont#directory#find([{state}]) 153 | Return a glyph (|String|) of a given {state} directory. The following 154 | state is available in default set 155 | 156 | State Description~ 157 | "" Default directory 158 | "open" Opend directory 159 | "close" Closed directory 160 | "symlink" Symlinked directory 161 | 162 | For example: 163 | > 164 | echo nerdfont#directory#find() 165 | "  166 | echo nerdfont#directory#find('open') 167 | "  168 | < 169 | *nerdfont#fileformat#find()* 170 | nerdfont#fileformat#find([{fileformat}]) 171 | Return a glyph (|String|) of a given {fileformat}. If {fileformat} is 172 | omitted, 'fileformat' of the current buffer is used instead. 173 | 174 | *nerdfont#path#basename#find()* 175 | nerdfont#path#basename#find({path}) 176 | Return a glyph (|String|) of a given {path} by matching basename. 177 | 178 | *nerdfont#path#extension#find()* 179 | nerdfont#path#extension#find({path}) 180 | Return a glyph (|String|) of a given {path} by matching extension. 181 | 182 | *nerdfont#path#pattern#find()* 183 | nerdfont#path#pattern#find({path}) 184 | Return a glyph (|String|) of a given {path} by matching pattern. 185 | 186 | *nerdfont#path#clear_cache()* 187 | nerdfont#platform#find([{platform}]) 188 | Return a glyph (|String|) of a given {platform}. If {platform} is 189 | omitted, the running platform will be automatically detected. 190 | The following platform is available in default set. 191 | 192 | Platform Description~ 193 | "windows" Windows 194 | "macos" macOS 195 | "arch" Arch Linux 196 | "ubuntu" Ubuntu 197 | "debian" Debian 198 | "centos" CentOS 199 | "docker" Docker container 200 | "linux" Other linux/unix 201 | 202 | Note that it internally call "lsb_release -i" to detect linux 203 | distribution if needed and the result is cached. 204 | 205 | 206 | ============================================================================= 207 | vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl 208 | -------------------------------------------------------------------------------- /plugin/nerdfont.vim: -------------------------------------------------------------------------------- 1 | " Allow easy detection of nerdfont plugin loaded 2 | if exists("g:loaded_nerdfont") 3 | finish 4 | endif 5 | let g:loaded_nerdfont = 1 6 | -------------------------------------------------------------------------------- /test/.themisrc: -------------------------------------------------------------------------------- 1 | if &encoding ==# 'latin1' 2 | set encoding=utf-8 3 | endif 4 | 5 | " Force English interface 6 | try 7 | language message C 8 | catch 9 | endtry 10 | set helplang=en 11 | 12 | let s:assert = themis#helper('assert') 13 | call themis#option('recursive', 1) 14 | call themis#option('reporter', 'dot') 15 | call themis#helper('command').with(s:assert) 16 | 17 | call themis#log(substitute(execute('version'), '^\%(\r\?\n\)*', '', '')) 18 | call themis#log('-----------------------------------------------------------') 19 | call themis#log('$LANG: ' . $LANG) 20 | call themis#log('&encoding: ' . &encoding) 21 | call themis#log('&termencoding: ' . &termencoding) 22 | call themis#log('&fileencodings: ' . &fileencodings) 23 | call themis#log('&fileformats: ' . &fileformats) 24 | call themis#log('&shellslash: ' . (exists('&shellslash') ? &shellslash : 'DISABLED')) 25 | call themis#log('&hidden: ' . &hidden) 26 | call themis#log('&runtimepath:') 27 | for s:runtimepath in split(&runtimepath, ',') 28 | call themis#log(' ' . s:runtimepath) 29 | endfor 30 | call themis#log('-----------------------------------------------------------') 31 | -------------------------------------------------------------------------------- /test/nerdfont/directory.vimspec: -------------------------------------------------------------------------------- 1 | Describe nerdfont#directory 2 | Describe #find({path}) 3 | It returns a default directory glyph 4 | let glyph = nerdfont#directory#find() 5 | Assert Equals(glyph, '') 6 | End 7 | 8 | It returns an opened directory glyph for 'open' 9 | let glyph = nerdfont#directory#find('open') 10 | Assert Equals(glyph, '') 11 | End 12 | 13 | It returns an closed directory glyph for 'close' 14 | let glyph = nerdfont#directory#find('close') 15 | Assert Equals(glyph, '') 16 | End 17 | 18 | It returns an symlinked directory glyph for 'symlink' 19 | let glyph = nerdfont#directory#find('symlink') 20 | Assert Equals(glyph, '') 21 | End 22 | 23 | It returns an empty string for 'hogehogefoobar' 24 | let glyph = nerdfont#directory#find('hogehogefoobar') 25 | Assert Equals(glyph, '') 26 | End 27 | End 28 | End 29 | -------------------------------------------------------------------------------- /test/nerdfont/fileformat.vimspec: -------------------------------------------------------------------------------- 1 | Describe nerdfont#fileformat 2 | Describe #find({path}) 3 | It returns a windows glyph for 'dos' 4 | let glyph = nerdfont#fileformat#find('dos') 5 | Assert Equals(glyph, '') 6 | End 7 | 8 | It returns an apple glyph for 'mac' 9 | let glyph = nerdfont#fileformat#find('mac') 10 | Assert Equals(glyph, '') 11 | End 12 | 13 | It returns a linux glyph for 'unix' 14 | let glyph = nerdfont#fileformat#find('unix') 15 | Assert Equals(glyph, '') 16 | End 17 | 18 | It returns an empty string for 'hogehogefoobar' 19 | let glyph = nerdfont#fileformat#find('hogehogefoobar') 20 | Assert Equals(glyph, '') 21 | End 22 | End 23 | End 24 | -------------------------------------------------------------------------------- /test/nerdfont/path/basename.vimspec: -------------------------------------------------------------------------------- 1 | Describe nerdfont#path#basename 2 | Describe #find({path}) 3 | It returns a gulpfile glyph for 'gulpfile.js' 4 | let glyph = nerdfont#path#basename#find('gulpfile.js') 5 | Assert Equals(glyph, '') 6 | End 7 | 8 | It returns a Docker glyph for 'dockerfile' 9 | let glyph = nerdfont#path#basename#find('dockerfile') 10 | Assert Equals(glyph, '') 11 | End 12 | 13 | It returns a Key glyph for 'license' 14 | let glyph = nerdfont#path#basename#find('license') 15 | Assert Equals(glyph, '') 16 | End 17 | 18 | It returns an empty string for 'hogehogefoobar' 19 | let glyph = nerdfont#path#basename#find('hogehogefoobar') 20 | Assert Equals(glyph, '') 21 | End 22 | End 23 | End 24 | -------------------------------------------------------------------------------- /test/nerdfont/path/extension.vimspec: -------------------------------------------------------------------------------- 1 | Describe nerdfont#path#extension 2 | Describe #find({path}) 3 | It returns a code glyph for 'index.html' 4 | let glyph = nerdfont#path#extension#find('index.html') 5 | Assert Equals(glyph, '') 6 | End 7 | 8 | It returns a JS glyph for 'index.js' 9 | let glyph = nerdfont#path#extension#find('index.js') 10 | Assert Equals(glyph, '') 11 | End 12 | 13 | It returns a Ruby glyph for 'index.rb' 14 | let glyph = nerdfont#path#extension#find('index.rb') 15 | Assert Equals(glyph, '') 16 | End 17 | 18 | It returns an empty string for 'hogehogefoobar' 19 | let glyph = nerdfont#path#extension#find('hogehogefoobar') 20 | Assert Equals(glyph, '') 21 | End 22 | End 23 | End 24 | -------------------------------------------------------------------------------- /test/nerdfont/path/pattern.vimspec: -------------------------------------------------------------------------------- 1 | Describe nerdfont#path#pattern 2 | Describe #find({path}) 3 | It returns a jQuery glyph for 'xxxxxjquery.yyyyy.js' 4 | let glyph = nerdfont#path#pattern#find('xxxxxjquery.yyyyy.js') 5 | Assert Equals(glyph, '') 6 | End 7 | 8 | It returns a Angular glyph for 'xxxxxangular.yyyyy.js' 9 | let glyph = nerdfont#path#pattern#find('xxxxxangular.yyyyy.js') 10 | Assert Equals(glyph, '') 11 | End 12 | 13 | It returns a Vagrant glyph for 'Vagrantfile' 14 | let glyph = nerdfont#path#pattern#find('Vagrantfile') 15 | Assert Equals(glyph, '') 16 | End 17 | 18 | It returns an empty string for 'hogehogefoobar' 19 | let glyph = nerdfont#path#pattern#find('hogehogefoobar') 20 | Assert Equals(glyph, '') 21 | End 22 | End 23 | End 24 | -------------------------------------------------------------------------------- /test/nerdfont/platform.vimspec: -------------------------------------------------------------------------------- 1 | Describe nerdfont#platform 2 | Describe #find({path}) 3 | It returns a windows glyph for 'windows' 4 | let glyph = nerdfont#platform#find('windows') 5 | Assert Equals(glyph, '') 6 | End 7 | 8 | It returns an apple glyph for 'macos' 9 | let glyph = nerdfont#platform#find('macos') 10 | Assert Equals(glyph, '') 11 | End 12 | 13 | It returns a linux glyph for 'linux' 14 | let glyph = nerdfont#platform#find('linux') 15 | Assert Equals(glyph, '') 16 | End 17 | 18 | It returns an empty string for 'hogehogefoobar' 19 | let glyph = nerdfont#platform#find('hogehogefoobar') 20 | Assert Equals(glyph, '') 21 | End 22 | End 23 | End 24 | -------------------------------------------------------------------------------- /test/run_themis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | themis --version 3 | 4 | export THEMIS_VIM="vim" 5 | themis --reporter dot 6 | 7 | export THEMIS_VIM="nvim" 8 | export THEMIS_ARGS="-e -s --headless" 9 | themis --reporter dot 10 | --------------------------------------------------------------------------------