├── .gitignore ├── README-legacy.md ├── README.md ├── README_cn.md ├── Ultisnips ├── README.md ├── c.snippets ├── cs.snippets ├── dart.snippets ├── go.snippets ├── java.snippets ├── javascript.snippets ├── markdown.snippets ├── python.snippets ├── racket.snippets ├── swift.snippets ├── tex.snippets ├── typescriptreact.snippets └── vim.snippets ├── autoload └── plug.vim ├── coc-settings.json ├── cursor.vim ├── cursor_for_qwerty.vim ├── default_configs └── _machine_specific_default.vim ├── demo.png ├── ftplugin ├── c.vim ├── cs.vim ├── dart.vim ├── go.vim ├── graphml.vim ├── java.vim ├── markdown.vim ├── prisma.vim ├── racket.vim ├── swift.vim └── text.vim ├── init.vim ├── lua └── swap_ternary.lua ├── md-snippets.vim ├── sample_vimspector_json └── python.json └── tmp └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | .DS_Store 3 | view/ 4 | plugged/ 5 | sessions/ 6 | autoload/plug.vim.old 7 | tmp/ 8 | .netrwhist 9 | _machine_specific.vim 10 | .vim-bookmarks 11 | 12 | -------------------------------------------------------------------------------- /README-legacy.md: -------------------------------------------------------------------------------- 1 | ## My NeoVim Config 2 | 3 | ### Documentation: 4 | 5 | #### Check Out [This](https://kjhuanhao.github.io/2019/08/24/Theniceboy-s-nvim-configuration/) by [kjhuanhao](https://github.com/kjhuanhao) 6 | 7 | #### Simplified Version Coming Up... 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ##
The Ultimate NeoVim Config for [Colemak](https://colemak.com/) Users
2 |
Sponsored by Instaboard
3 |
4 | 5 |
6 | 7 | [中文版](./README_cn.md) 8 | 9 | Please **DO NOT** just copy this configuration folder without really looking at it! Please, at least, read this README file! 10 | 11 | 12 | 13 | * [Requirements](#requirements) 14 | * [After Installation, You Need To](#after-installation-you-need-to) 15 | * [After Installation, You Might Want To](#after-installation-you-might-want-to) 16 | - [First of all](#first-of-all) 17 | - [For Python Debugger (via `vimspector`)](#for-python-debugger-via-vimspector) 18 | - [Config `Python` path](#config-python-path) 19 | - [For Taglist:](#for-taglist) 20 | - [For FZF](#for-fzf) 21 | - [And also...](#and-also) 22 | * [Keyboard Shortcuts](#keyboard-shortcuts) 23 | - [1 Basic Editor Features](#1-basic-editor-features) 24 | + [1.1 The Most Basics](#11-the-most-basics) 25 | + [1.2 Remapped Cursor Movement](#12-remapped-cursor-movement) 26 | + [1.3 Remapped Insert Mode Keys](#13-remapped-insert-mode-keys) 27 | + [1.4 Remapped Text Manipulating Commands in Normal Mode](#14-remapped-text-manipulating-commands-in-normal-mode) 28 | + [1.5 Other Useful Normal Mode Remappings](#15-other-useful-normal-mode-remappings) 29 | + [1.6 Remapped Commands in Visual Mode](#16-remapped-commands-in-visual-mode) 30 | - [2 Window Management](#2-window-management) 31 | + [2.1 Creating Window Through Split Screen](#21-creating-window-through-split-screen) 32 | + [2.2 Moving the Cursor Between Different Windows](#22-moving-the-cursor-between-different-windows) 33 | + [2.3 Resizing Different Windows](#23-resizing-different-windows) 34 | + [2.4 Closing Windows](#24-closing-windows) 35 | - [3 Tab Management](#3-tab-management) 36 | - [4 Terminal Keyboard Shortcuts](#4-terminal-keyboard-shortcuts) 37 | * [Plugins Keybindings (Screenshots/GIF provided!)](#plugins-keybindings-screenshotsgif-provided) 38 | - [AutoCompletion](#autocompletion) 39 | + [COC (AutoCompletion)](#coc-autocompletion) 40 | + [coc-snippets](#coc-snippets) 41 | - [File Navigation](#file-navigation) 42 | + [coc-explorer (file browser)](#coc-explorer-file-browser) 43 | + [rnvimr - file browser](#rnvimr---file-browser) 44 | + [FZF - the fuzzy file finder](#fzf---the-fuzzy-file-finder) 45 | + [xtabline (the fancy tab line)](#xtabline-the-fancy-tab-line) 46 | - [Text Editing Plugins](#text-editing-plugins) 47 | + [vim-table-mode](#vim-table-mode) 48 | + [Undotree](#undotree) 49 | + [vim-visual-multi](#vim-visual-multi) 50 | + [vim-surround](#vim-surround) 51 | + [vim-subversive](#vim-subversive) 52 | + [vim-easy-align](#vim-easy-align) 53 | + [AutoFormat](#autoformat) 54 | + [vim-markdown-toc (generate table of contents for markdown files)](#vim-markdown-toc-generate-table-of-contents-for-markdown-files) 55 | - [Navigation Within Buffer](#navigation-within-buffer) 56 | + [Vista.vim](#vistavim) 57 | - [Find and Replace](#find-and-replace) 58 | + [Far.vim - find and replace](#farvim---find-and-replace) 59 | - [Git Related](#git-related) 60 | + [vim-gitgutter](#vim-gitgutter) 61 | + [fzf-gitignore](#fzf-gitignore) 62 | - [Others](#others) 63 | + [vim-calendar](#vim-calendar) 64 | + [Goyo - Work without distraction](#goyo---work-without-distraction) 65 | + [suda.vim](#sudavim) 66 | + [coc-translator](#coc-translator) 67 | * [Custom Snippets](#custom-snippets) 68 | - [Markdown](#markdown) 69 | * [Some Weird Stuff](#some-weird-stuff) 70 | - [Press `tx` and enter your text](#press-tx-and-enter-your-text) 71 | - [Customized Vertical Cursor Movement](#customized-vertical-cursor-movement) 72 | 73 | 74 | 75 | ## Requirements 76 | - This nvim configuration **REQUIRES** NeoVim 0.6.0+ 77 | ## After Installation, You Need To 78 | - Install `pip3`, and do `pip3 install --user pynvim` 79 | - Install `node`, and do `npm install -g neovim` 80 | - Install nerd-fonts (actually it's optional but it looks real good) 81 | 82 | ## After Installation, You Might Want To 83 | ### First of all 84 | - Do `:checkhealth` 85 | 86 | ### For Python Debugger (via `vimspector`) 87 | - Install `debugpy` (`pip`) 88 | 89 | ### Config `Python` path 90 | - Well, make sure you have python 91 | - See `_machine_specific.vim` 92 | 93 | ### For Taglist: 94 | - Install `ctags` for function/class/variable list 95 | 96 | ### For FZF 97 | - Install `fzf` 98 | - Install `ag` (`the_silver_searcher`) 99 | 100 | ### And also... 101 | - Install `figlet` for inputing text ASCII art 102 | - Install `xclip` for system clipboard access (`Linux` and `xorg` only) 103 | 104 | ## Keyboard Shortcuts 105 | ### 1 Basic Editor Features 106 | #### 1.1 The Most Basics 107 | **`k`** : switchs to **`INSERT`** : mode (same as key `i` in vanilla vim) 108 | 109 | **`Q`** : quits current vim window (same as command `:q` in vanilla vim) 110 | 111 | **`S`** : saves the current file (same as command `:w` in vanilla vim) 112 | 113 | **_IMPORTANT_** 114 | 115 | Since the `i` key has been mapped to `k`, every command (combination) that involves `i` should use `k` instead (for example, `ciw` should be `ckw`). 116 | 117 | #### 1.2 Remapped Cursor Movement 118 | | Shortcut | Action | Equivalent | 119 | |------------|-----------------------------------------------------------|------------| 120 | | `u` | Cursor up a terminal line | `k` | 121 | | `e` | Cursor down a terminal line | `j` | 122 | | `n` | Cursor left | `h` | 123 | | `i` | Cursor right | `l` | 124 | | `U` | Cursor up 5 terminal lines | `5k` | 125 | | `E` | Cursor down 5 terminal lines | `5j` | 126 | | `N` | Cursor to the start of the line | `0` | 127 | | `I` | Cursor to the end of the line | `$` | 128 | | `Ctrl` `u` | Move the view port up 5 lines without moving the cursor | `Ctrl` `y` | 129 | | `Ctrl` `e` | Move the view port down 5 lines without moving the cursor | `Ctrl` `e` | 130 | | `h` | Move to the end of this word | `e` | 131 | | `W` | Move cursor five words forward | `5w` | 132 | | `B` | Move cursor five words forward | `5b` | 133 | 134 | #### 1.3 Remapped Insert Mode Keys 135 | | Shortcut | Action | 136 | |------------|----------------------------------------------------------------------| 137 | | `Ctrl` `a` | Move cursor to the end of the line | 138 | | `Ctrl` `u` | Move the character on the right of the cursor to the end of the line | 139 | 140 | #### 1.4 Remapped Text Manipulating Commands in Normal Mode 141 | | Shortcut | Action | 142 | |-----------------|---------------------------------------| 143 | | `l` | **undo** | 144 | | `<` | Un-indent | 145 | | `>` | Indent | 146 | | `SPACE` `SPACE` | Goto the next placeholder (`<++>`) | 147 | 148 | #### 1.5 Other Useful Normal Mode Remappings 149 | | Shortcut | Action | 150 | |-----------------|------------------------------------------------| 151 | | `r` | **Compile/Run the current file** | 152 | | `SPACE` `s` `c` | Toggle spell suggestion a | 153 | | `SPACE` `d` `w` | Find adjacent duplicated word | 154 | | `SPACE` `t` `t` | Convert every 4 Spaces to a tab | 155 | | `SPACE` `o` | Fold | 156 | | `SPACE` `-` | Previous quick-fix position | 157 | | `SPACE` `+` | Next quick-fix position | 158 | | `\` `p` | Show the path of the current file | 159 | | `SPACE` `/` | Create a new terminal below the current window | 160 | 161 | #### 1.6 Remapped Commands in Visual Mode 162 | | Shortcut | Action | 163 | |-----------------|----------------------------------------| 164 | | `Y` | Copy selected text to system clipboard | 165 | 166 | 167 | ### 2 Window Management 168 | #### 2.1 Creating Window Through Split Screen 169 | | Shortcut | Action | 170 | |-------------|-----------------------------------------------------------------------------| 171 | | `s` `u` | Create a new horizontal split screen and place it above the current window | 172 | | `s` `e` | Create a new horizontal split screen and place it below the current window | 173 | | `s` `n` | Create a new vertical split screen and place it left to the current window | 174 | | `s` `i` | Create a new vertical split screen and place it right to the current window | 175 | | `s` `v` | Set the two splits to be vertical | 176 | | `s` `h` | Set the two splits to be horizontal | 177 | | `s` `r` `v` | Rotate splits and arrange splits vertically | 178 | | `s` `r` `h` | Rotate splits and arrange splits horizontally | 179 | 180 | #### 2.2 Moving the Cursor Between Different Windows 181 | | Shortcut | Action | 182 | |---------------|--------------------------------| 183 | | `SPACE` + `w` | Move cursor to the next window | 184 | | `SPACE` + `n` | Move cursor one window left | 185 | | `SPACE` + `i` | Move cursor one window right | 186 | | `SPACE` + `u` | Move cursor one window up | 187 | | `SPACE` + `e` | Move cursor one window down | 188 | 189 | #### 2.3 Resizing Different Windows 190 | Use the arrow keys to resize the current window. 191 | 192 | #### 2.4 Closing Windows 193 | | Shortcut | Action | 194 | |-------------|------------------------------------------------------------------------------------------------------------| 195 | | `Q` | Close the current window | 196 | | `SPACE` `q` | Close the window below the current window. (The current window will be closed if there is no window below) | 197 | 198 | ### 3 Tab Management 199 | | Shortcut | Action | 200 | |-------------|------------------| 201 | | `t` `u` | Create a new tab | 202 | | `t` `n` | Go one tab left | 203 | | `t` `i` | Go One tab right | 204 | | `t` `m` `n` | Move tab left | 205 | | `t` `m` `i` | Move tab right | 206 | 207 | ### 4 Terminal Keyboard Shortcuts 208 | | Shortcut | Action | 209 | |-------------|-------------------------------------------------------------| 210 | | `Ctrl` `n` | Escape from terminal input mode | 211 | 212 | ## Plugins Keybindings (Screenshots/GIF provided!) 213 | ### AutoCompletion 214 | #### [COC (AutoCompletion)](https://github.com/neoclide/coc.nvim) 215 | | Shortcut | Action | 216 | |-----------------|---------------------------| 217 | | `Space` `y` | **Get yank history list** | 218 | | `gd` | Go to definition | 219 | | `gr` | List references | 220 | | `gi` | List implementation | 221 | | `gy` | Go to type definition | 222 | | `Space` `r` `n` | Rename a variable | 223 | 224 | Gif 225 | 226 | #### [coc-snippets](https://github.com/neoclide/coc-snippets) 227 | | Shortcut | Action | 228 | |------------|--------------------------------------------------| 229 | | `Ctrl` `e` | Expand a snippet | 230 | | `Ctrl` `n` | (in snippet) Previous Cursor position in snippet | 231 | | `Ctrl` `e` | (in snippet) Next Cursor position in snippet | 232 | 233 | ![GIF Demo](https://raw.github.com/SirVer/ultisnips/master/doc/demo.gif) 234 | 235 | ### File Navigation 236 | #### [coc-explorer (file browser)](https://github.com/weirongxu/coc-explorer) 237 | | Shortcut | Action | 238 | |----------|-------------------------| 239 | | `tt` | **Open file browser** | 240 | | `?` | show help (in explorer) | 241 | 242 | Png 243 | 244 | #### [rnvimr - file browser](https://github.com/kevinhwang91/rnvimr) 245 | - [ ] Make sure you have ranger installed 246 | 247 | Press `R` to open Ranger (file selector) 248 | 249 | And Within rnvimr (ranger), you can: 250 | | Shortcut | Action | 251 | |------------|------------------------------------| 252 | | `Ctrl` `t` | Open the file in a new tab | 253 | | `Ctrl` `x` | Split up and down with the file | 254 | | `Ctrl` `v` | Split left and right with the file | 255 | 256 | Gif 257 | 258 | #### [FZF - the fuzzy file finder](https://github.com/junegunn/fzf.vim) 259 | | Shortcut | Action | 260 | |------------|--------------------| 261 | | `Ctrl` `p` | **FZF Files** | 262 | | `Ctrl` `u` | Move up 1 item | 263 | | `Ctrl` `e` | Move down 1 item | 264 | | `Ctrl` `w` | FZF Buffers | 265 | | `Ctrl` `f` | FZF Files' Content | 266 | | `Ctrl` `h` | FZF Recent Files | 267 | | `Ctrl` `t` | FZF Tags | 268 | 269 | Gif 270 | 271 | #### [xtabline (the fancy tab line)](https://github.com/mg979/vim-xtabline) 272 | | Shortcut | What it creates | 273 | |----------|-------------------| 274 | | `to` | Cycle tab mode | 275 | | `\p` | Show current path | 276 | 277 | Gif 278 | 279 | ### Text Editing Plugins 280 | #### [vim-table-mode](https://github.com/dhruvasagar/vim-table-mode) 281 | | Shortcut | Action | 282 | |-----------------|-------------------| 283 | | `SPACE` `t` `m` | Toggle table mode | 284 | | `SPACE` `t` `r` | Realign table | 285 | 286 | See `:help table-mode.txt` for more. 287 | 288 | #### [Undotree](https://github.com/mbbill/undotree) 289 | | Shortcut | Action | 290 | |---------------|---------------| 291 | | `Shift` + `L` | Open Undotree | 292 | | `u` | Newer Version | 293 | | `e` | Older Version | 294 | 295 | Png 296 | 297 | #### [vim-visual-multi](https://github.com/mg979/vim-visual-multi) 298 | | Shortcut | Action | 299 | |------------|--------------------------------------------------| 300 | | `Ctrl`+`k` | **Select next key (multiple cursors)** | 301 | | `q` | **Deselect the current keys (multiple cursors)** | 302 | | `-` | Select the previous key | 303 | | `=` | Select the next key | 304 | | `Esc` | Quit mutiple cursors | 305 | 306 | Gif 307 | Gif 308 | Gif 309 | Gif 310 | 311 | #### [vim-surround](https://github.com/tpope/vim-surround) 312 | To add surround (`string` -> `"string"`): 313 | ``` 314 | string 315 | ``` 316 | press: `yskw'`: 317 | ``` 318 | 'string' 319 | ``` 320 | 321 | To change surround 322 | ``` 323 | 'string' 324 | ``` 325 | press: `cs'"`: 326 | ``` 327 | "string" 328 | ``` 329 | 330 | Gif 331 | 332 | #### [vim-subversive](https://github.com/svermeulen/vim-subversive) 333 | New operator: `s`: 334 | 335 | You can execute `s` to substitute the text object provided by the motion with the contents of the default register (or an explicit register if provided). For example, you could execute `skw` to replace the current word under the cursor with the current yank, or `skp` to replace the paragraph, etc. 336 | 337 | #### [vim-easy-align](https://github.com/junegunn/vim-easy-align) 338 | Press `ga` + **symbol** in normal or visual mode to align text based on **symbol** 339 | 340 | Gif 341 | 342 | #### [AutoFormat](https://github.com/Chiel92/vim-autoformat) 343 | Press `\` `f` to format code 344 | 345 | #### [vim-markdown-toc (generate table of contents for markdown files)](https://github.com/mzlogin/vim-markdown-toc) 346 | In `markdown` files, type `:Gen` then tab, you'll see your options. 347 | 348 | Gif 349 | 350 | ### Navigation Within Buffer 351 | #### [Vista.vim](https://github.com/liuchengxu/vista.vim) 352 | Press `T` to toggle function and variable list 353 | 354 | Gif 355 | 356 | ### Find and Replace 357 | #### [Far.vim - find and replace](https://github.com/brooth/far.vim) 358 | Press `SPACE` `f` `r` to search in cwd. 359 | 360 | Gif 361 | 362 | ### Git Related 363 | #### [vim-gitgutter](https://github.com/airblade/vim-gitgutter) 364 | | Shortcut | Action | 365 | |-----------------|-----------------------------------| 366 | | `H` | **Show git hunk at current line** | 367 | | `SPACE` `g` `-` | Go to previous git hunk | 368 | | `SPACE` `g` `+` | Go to next git hunk | 369 | | `SPACE` `g` `f` | Fold everything except hunks | 370 | 371 | #### [fzf-gitignore](https://github.com/fszymanski/fzf-gitignore) 372 | Press `Space` `g` `i` to create a `.gitignore` file 373 | 374 | Png 375 | 376 | Png 377 | 378 | ### Others 379 | #### [vim-calendar](https://github.com/itchyny/calendar.vim) 380 | | Shortcut | Action | 381 | |----------|---------------| 382 | | `\` `\` | Show clock | 383 | | `\` `c` | Show calendar | 384 | 385 | Png 386 | 387 | #### [Goyo - Work without distraction](https://github.com/junegunn/goyo.vim) 388 | Press `g` `y` to toggle Goyo 389 | 390 | Png 391 | 392 | #### [suda.vim](https://github.com/lambdalisue/suda.vim) 393 | Forgot to `sudo vim ...`? Just do `:sudowrite` or `:sw` 394 | 395 | #### [coc-translator](https://github.com/voldikss/coc-translator) 396 | Press `ts` to **translate word under cursor**. 397 | 398 | Png 399 | 400 | ## Custom Snippets 401 | ### Markdown 402 | | Shortcut | What it creates | 403 | |----------|---------------------| 404 | | `,n` | --- | 405 | | `,b` | **Bold** text | 406 | | `,s` | ~~sliced~~ text | 407 | | `,i` | *italic* text | 408 | | `,d` | `code block` | 409 | | `,c` | big `block of code` | 410 | | `,m` | - [ ] check mark | 411 | | `,p` | picture | 412 | | `,a` | [link]() | 413 | | `,1` | # H1 | 414 | | `,2` | ## H2 | 415 | | `,3` | ### H3 | 416 | | `,4` | #### H4 | 417 | | `,l` | -------- | 418 | 419 | `,f` to go to the next `<++>` (placeholder) 420 | 421 | `,w` to go to the next `<++>` (placeholder) and then press `Enter` for you 422 | 423 | ## Some Weird Stuff 424 | ### Press `tx` and enter your text 425 | `tx Hello` 426 | ``` 427 | _ _ _ _ 428 | | | | | ___| | | ___ 429 | | |_| |/ _ \ | |/ _ \ 430 | | _ | __/ | | (_) | 431 | |_| |_|\___|_|_|\___/ 432 | ``` 433 | 434 | ### Customized Vertical Cursor Movement 435 | 436 | This NeoVim configuration includes a customized vertical cursor movement tailored for Colemak users. It can be located in `cursor.vim`, and it serves as an alternative to the "number + up/down" key combination. 437 | 438 | In order to move the cursor up `x` lines, press the `[` key, and treat the middle row of the Colemak keyboard layout ("arstdhneio") as number 1 to 0. Press the numbers that you'd like your cursor to move (`x`) and press the space bar. 439 | 440 | To move the cursor down, press the `'` key instead of the `[` key, and the rest would be the same. 441 | 442 | Example: 443 | | Shortcut | Action | 444 | |-------------------------|--------------------------------| 445 | | `[` `a` `o` `o` `SPACE` | Move the cursor up 100 lines | 446 | | `'` `a` `r` `s` `SPACE` | Move the cursor down 123 lines | 447 | | `[` `d` `o` `SPACE` | Move the cursor up 50 lines | 448 | 449 | **Note: As of now, you may only move vertically up to 199 lines with this key configuration!** 450 | 451 | -------------------------------------------------------------------------------- /README_cn.md: -------------------------------------------------------------------------------- 1 | ##
[Colemak](https://colemak.com/) 用户使用的 [NeoVim](https://neovim.io) 配置文件
2 | 3 |
4 | 5 | [English Version](./README.md) 6 | 7 | 请不要只复制这份配置文件夹而不认真看它!请至少阅读一下这份自述文件! 8 | 9 | --- 10 | 11 | 第一版翻译: [**EvanMeek**](https://github.com/EvanMeek) 12 | 13 | 第二版翻译 (当前版本): [**KiteAB**](https://github.com/KiteAB) 14 | 15 | 16 | 17 | * [安装此配置后你需要做的事](#安装此配置后你需要做的事) 18 | * [安装此配置后你可能想做的事](#安装此配置后你可能想做的事) 19 | - [首先](#首先) 20 | - [Python 程序调试 (通过 `vimspector` 实现)](#python-程序调试-通过-vimspector-实现) 21 | - [配置 `Python` 路径](#配置-python-路径) 22 | - [标签表](#标签表) 23 | - [FZF](#fzf) 24 | - [其它...](#其它) 25 | * [快捷键](#快捷键) 26 | - [1 基础编辑器特性](#1-基础编辑器特性) 27 | + [1.1 最基本的键位](#11-最基本的键位) 28 | + [1.2 改变了的光标移动方式](#12-改变了的光标移动方式) 29 | + [1.3 改变了插入模式的键位](#13-改变了插入模式的键位) 30 | + [1.4 改变了在普通模式下的操作键位](#14-改变了在普通模式下的操作键位) 31 | + [1.5 其它在普通模式下有用的键位](#15-其它在普通模式下有用的键位) 32 | + [1.6 增加了在可视模式下的命令](#16-增加了在可视模式下的命令) 33 | - [2 窗口管理](#2-窗口管理) 34 | + [2.1 通过分裂屏幕创造窗口](#21-通过分裂屏幕创造窗口) 35 | + [2.2 切换不同的窗口](#22-切换不同的窗口) 36 | + [2.3 为不同的窗口调整大小](#23-为不同的窗口调整大小) 37 | + [2.4 关闭窗口](#24-关闭窗口) 38 | - [3 标签页管理](#3-标签页管理) 39 | - [4 终端键盘快捷键](#4-终端键盘快捷键) 40 | * [插件快捷键 (截图/动图已经准备好!)](#插件快捷键-截图动图已经准备好) 41 | - [自动补全](#自动补全) 42 | + [COC (自动补全)](#coc-自动补全) 43 | + [Ultisnips](#ultisnips) 44 | - [代码调试](#代码调试) 45 | + [vimspector (代码调试插件)](#vimspector-代码调试插件) 46 | - [文件浏览](#文件浏览) 47 | + [coc-explorer - 文件浏览器](#coc-explorer---文件浏览器) 48 | + [rnvimr - 文件浏览器](#rnvimr---文件浏览器) 49 | + [FZF - 模糊文件查找器](#fzf---模糊文件查找器) 50 | + [xtabline - 精致的顶栏](#xtabline---精致的顶栏) 51 | - [文字编辑](#文字编辑) 52 | + [vim-table-mode](#vim-table-mode) 53 | + [Undotree](#undotree) 54 | + [vim-multiple-cursors](#vim-multiple-cursors) 55 | + [vim-surround](#vim-surround) 56 | + [vim-subversive](#vim-subversive) 57 | + [vim-easy-align](#vim-easy-align) 58 | + [AutoFormat](#autoformat) 59 | + [vim-markdown-toc (为 Markdown 文件生成目录)](#vim-markdown-toc-为-markdown-文件生成目录) 60 | - [缓冲区内导航](#缓冲区内导航) 61 | + [vim-easy-motion](#vim-easy-motion) 62 | + [Vista.vim](#vistavim) 63 | + [vim-signiture - 书签](#vim-signiture---书签) 64 | - [查找与替换](#查找与替换) 65 | + [Far.vim - 查找与替换](#farvim---查找与替换) 66 | - [Git 相关](#git-相关) 67 | + [vim-gitgutter](#vim-gitgutter) 68 | + [fzf-gitignore](#fzf-gitignore) 69 | - [其它](#其它-1) 70 | + [vim-calendar](#vim-calendar) 71 | + [Goyo - 不会分心地工作](#goyo---不会分心地工作) 72 | + [suda.vim](#sudavim) 73 | + [coc-translator](#coc-translator) 74 | * [自定义代码片段补全](#自定义代码片段补全) 75 | - [Markdown](#markdown) 76 | * [一些奇怪的东西](#一些奇怪的东西) 77 | - [按 `tx` 然后输入你想要的文字](#按-tx-然后输入你想要的文字) 78 | - [自定义垂直光标移动](#自定义垂直光标移动) 79 | 80 | 81 | 82 | ## 安装此配置后你需要做的事 83 | - [ ] 安装 `pynvim` (使用 `pip`) 84 | - [ ] 安装 `nodejs`, 然后在终端输入 `npm install -g neovim` 85 | - [ ] 安装 nerd-fonts (尽管它是可选的,但是安装之后看上去十分地酷) 86 | 87 | ## 安装此配置后你可能想做的事 88 | ### 首先 89 | - [ ] 执行 `:checkhealth` 90 | 91 | ### Python 程序调试 (通过 `vimspector` 实现) 92 | - [ ] 安装 `debugpy` (使用 `pip`) 93 | 94 | ### 配置 `Python` 路径 95 | - [ ] 确保你安装了 Python 96 | - [ ] 查看 `_machine_specific.vim` 文件 97 | 98 | ### 标签表 99 | - [ ] 安装 `ctags` 以获得类/函数/变量的三重支持 100 | 101 | ### FZF 102 | - [ ] 安装 `fzf` 103 | - [ ] 安装 `ag` (`the_silver_searcher` 需要) 104 | 105 | ### 其它... 106 | - [ ] 安装 `figlet` 以输入 ASCII 艺术字 107 | - [ ] 安装 `xclip` 以获得系统剪切板访问支持 (仅 `Linux` 与 `xorg` 需要) 108 | 109 | ## 快捷键 110 | ### 1 基础编辑器特性 111 | #### 1.1 最基本的键位 112 | **`k`** : 切换至 **`插入`** : 一种模式 (在原版 Vim 中与 `i` 键相同) 113 | 114 | **`Q`** : 退出当前 Vim 窗口 (在原版 Vim 中与命令 `:q` 相同) 115 | 116 | **`S`** : 保存当前文件 (在原版 Vim 中与命令 `:w` 相同) 117 | 118 | **_重要_** 119 | 120 | 因为 `i` 键被改为了 `k` 键, 所有包含 `i` 键的命令都必须将 `i` 改为 `k` (比如 `ciw` 应被更正为 `ckw`) 121 | 122 | #### 1.2 改变了的光标移动方式 123 | | 快捷键 | 行为 | 等于 (QWERTY 键盘布局中的哪些键) | 124 | |------------|--------------------------------|----------------------------------| 125 | | `u` | 将光标向上移动一行 | `k` | 126 | | `e` | 将光标向下移动一行 | `j` | 127 | | `n` | 将光标向左移动一格 | `h` | 128 | | `i` | 将光标向右移动一格 | `l` | 129 | | `U` | 将光标向上移动五行 | `5k` | 130 | | `E` | 将光标向下移动五行 | `5j` | 131 | | `N` | 将光标移至当前行的第一个字符 | `0` | 132 | | `I` | 将光标移至当前行的最后一个字符 | `$` | 133 | | `Ctrl` `u` | 将视角向上移动五行而不移动光标 | `Ctrl` `y` | 134 | | `Ctrl` `e` | 将视角向下移动五行而不移动光标 | `Ctrl` `e` | 135 | | `h` | 将光标移至当前单词的末尾 | `e` | 136 | | `W` | 将光标移至五个单词后的末尾 | `5w` | 137 | | `B` | 将光标移至五个单词前的开头 | `5b` | 138 | 139 | #### 1.3 改变了插入模式的键位 140 | | 快捷键 | 行为 | 141 | |------------|----------------------------------| 142 | | `Ctrl` `a` | 将光标移至当前行的末尾 | 143 | | `Ctrl` `u` | 将光标所在的字母移至当前行的末尾 | 144 | 145 | #### 1.4 改变了在普通模式下的操作键位 146 | | 快捷键 | 行为 | 147 | |-----------------|----------------------------------| 148 | | `l` | **撤销** | 149 | | `<` | 反向缩进 | 150 | | `>` | 缩进 | 151 | | `SPACE` `SPACE` | 删除下一个 `<++>` 并进入插入模式 | 152 | 153 | #### 1.5 其它在普通模式下有用的键位 154 | | 快捷键 | 行为 | 155 | |-----------------|--------------------------------| 156 | | `r` | **编译/运行当前文件** | 157 | | `SPACE` `s` `c` | 开关拼写检查 | 158 | | `SPACE` `d` `w` | 寻找近处的重复单词 | 159 | | `SPACE` `t` `t` | 将四个空格转换为制表符 | 160 | | `SPACE` `o` | 折叠代码 | 161 | | `SPACE` `-` | 上一个快速修复位置 | 162 | | `SPACE` `+` | 下一个快速修复位置 | 163 | | `\` `p` | 显示当前文件的路径 | 164 | | `SPACE` `/` | 在当前窗口下方新建一个终端窗口 | 165 | 166 | #### 1.6 增加了在可视模式下的命令 167 | | 快捷键 | 行为 | 168 | |--------|------------------------------| 169 | | `Y` | 复制选中文本至**系统剪切板** | 170 | 171 | 172 | ### 2 窗口管理 173 | #### 2.1 通过分裂屏幕创造窗口 174 | | 快捷键 | 行为 | 175 | |-------------|----------------------------------------| 176 | | `s` `u` | 新建一个分屏并把它放置在当前窗口的上面 | 177 | | `s` `e` | 新建一个分屏并把它放置在当前窗口的下面 | 178 | | `s` `n` | 新建一个分屏并把它放置在当前窗口的左边 | 179 | | `s` `i` | 新建一个分屏并把它放置在当前窗口的右边 | 180 | | `s` `v` | 将两个分屏垂直放置 | 181 | | `s` `h` | 将两个分屏水平放置 | 182 | | `s` `r` `v` | 将所有分屏垂直放置 | 183 | | `s` `r` `h` | 将所有分屏水平放置 | 184 | 185 | #### 2.2 切换不同的窗口 186 | | 快捷键 | 行为 | 187 | |---------------|----------------| 188 | | `SPACE` + `w` | 移至下一个窗口 | 189 | | `SPACE` + `n` | 移至左边的窗口 | 190 | | `SPACE` + `i` | 移至右边的窗口 | 191 | | `SPACE` + `u` | 移至上面的窗口 | 192 | | `SPACE` + `e` | 移至下面的窗口 | 193 | 194 | #### 2.3 为不同的窗口调整大小 195 | 用方向键更改当前窗口的大小 196 | 197 | #### 2.4 关闭窗口 198 | | 快捷键 | 行为 | 199 | |-------------|-------------------------------------------------------------| 200 | | `Q` | 关闭当前窗口 | 201 | | `SPACE` `q` | 关闭当前窗口下面的窗口 (如果下面没有窗口,则当前窗口将关闭) | 202 | 203 | ### 3 标签页管理 204 | | 快捷键 | 行为 | 205 | |-------------|--------------------------| 206 | | `t` `u` | 新建一个标签页 | 207 | | `t` `n` | 移至左侧标签页 | 208 | | `t` `i` | 移至右侧标签页 | 209 | | `t` `m` `n` | 将当前标签页向左移动一格 | 210 | | `t` `m` `i` | 将当前标签页向右移动一格 | 211 | 212 | ### 4 终端键盘快捷键 213 | | 快捷键 | 行为 | 214 | |------------|------------------| 215 | | `Ctrl` `n` | 退出终端输入模式 | 216 | 217 | ## 插件快捷键 (截图/动图已经准备好!) 218 | ### 自动补全 219 | #### [COC (自动补全)](https://github.com/neoclide/coc.nvim) 220 | | 快捷键 | 行为 | 221 | |-----------------|--------------------| 222 | | `Space` `y` | **打开剪切板历史** | 223 | | `gd` | 列出定义列表 | 224 | | `gr` | 列出参考列表 | 225 | | `gi` | 待办事项清单 | 226 | | `gy` | 转至类型定义 | 227 | | `Space` `r` `n` | 重命名变量 | 228 | 229 | Gif 230 | 231 | #### [Ultisnips](https://github.com/SirVer/ultisnips) 232 | | 快捷键 | 行为 | 233 | |------------|--------------------------| 234 | | `Ctrl` `e` | 召唤一个代码片段 | 235 | | `Ctrl` `n` | 在一个代码片段中前移光标 | 236 | | `Ctrl` `e` | 在一个代码片段中后移光标 | 237 | 238 | ![GIF Demo](https://raw.github.com/SirVer/ultisnips/master/doc/demo.gif) 239 | 240 | ### 代码调试 241 | #### [vimspector (代码调试插件)](https://github.com/puremourning/vimspector) 242 | | 快捷键 | 函数 | 243 | |--------|--------------------------------------------| 244 | | `F5` | 继续调试,如果不在一个调试中则开始进行调试 | 245 | | `F3` | 终止调试 | 246 | | `F4` | 用相同的配置重新开始调试 | 247 | | `F6` | 暂停调试 | 248 | | `F9` | 在当前行上切换行的断点 | 249 | | `F8` | 在光标下为表达式添加函数断点 | 250 | | `F10` | 完成步骤 | 251 | | `F11` | 下一步骤 | 252 | | `F12` | 退出当前函数范围 | 253 | 254 | Gif 255 | 256 | ### 文件浏览 257 | #### [coc-explorer - 文件浏览器](https://github.com/weirongxu/coc-explorer) 258 | | 快捷键 | 行为 | 259 | |--------|-----------------------| 260 | | `tt` | **打开文件浏览器** | 261 | | `?` | 查看帮助 (在浏览器中) | 262 | 263 | Png 264 | 265 | #### [rnvimr - 文件浏览器](https://github.com/kevinhwang91/rnvimr) 266 | - [ ] 确定你已经安装了 ranger 267 | 268 | 按 `R` 键打开 ranger (文件选择器) 269 | 270 | 在 rnvimr (ranger) 中, 你可以: 271 | | 快捷键 | 行为 | 272 | |------------|----------------------| 273 | | `Ctrl` `t` | 在新标签页中打开文件 | 274 | | `Ctrl` `x` | 上下分裂打开当前文件 | 275 | | `Ctrl` `v` | 左右分裂打开所选文件 | 276 | 277 | Gif 278 | 279 | #### [FZF - 模糊文件查找器](https://github.com/junegunn/fzf.vim) 280 | | 快捷键 | 行为 | 281 | |------------|------------------| 282 | | `Ctrl` `p` | **模糊查找文件** | 283 | | `Ctrl` `u` | 向上移动一格 | 284 | | `Ctrl` `e` | 向下移动一格 | 285 | | `Ctrl` `w` | 模糊查找缓冲区 | 286 | | `Ctrl` `f` | 模糊查找文件内容 | 287 | | `Ctrl` `h` | 模糊查找历史文件 | 288 | | `Ctrl` `t` | 模糊查找标签 | 289 | 290 | Gif 291 | 292 | #### [xtabline - 精致的顶栏](https://github.com/mg979/vim-xtabline) 293 | | 快捷键 | 行为 | 294 | |--------|--------------------| 295 | | `to` | 开关循环标签页模式 | 296 | | `\p` | 显示当前路径 | 297 | 298 | Gif 299 | 300 | ### 文字编辑 301 | #### [vim-table-mode](https://github.com/dhruvasagar/vim-table-mode) 302 | | 快捷键 | 行为 | 303 | |-----------------|--------------| 304 | | `SPACE` `t` `m` | 开关表格模式 | 305 | | `SPACE` `t` `r` | 重组表格 | 306 | 307 | See `:help table-mode.txt` for more. 308 | 309 | #### [Undotree](https://github.com/mbbill/undotree) 310 | | 快捷键 | 行为 | 311 | |---------------|--------------| 312 | | `Shift` + `L` | 打开撤回历史 | 313 | | `u` | 更新的记录 | 314 | | `e` | 更老的记录 | 315 | 316 | Png 317 | 318 | #### [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors) 319 | | 快捷键 | 行为 | 320 | |------------|-----------------------------| 321 | | `Ctrl`+`k` | **选择下一个键 (多重光标)** | 322 | | `Alt`+`k` | **选择所有键 (多重光标)** | 323 | | `Ctrl`+`p` | 选择上一个键 | 324 | | `Ctrl`+`s` | 跳过键 | 325 | | `Esc` | 退出多重光标 | 326 | 327 | Gif 328 | Gif 329 | Gif 330 | Gif 331 | 332 | #### [vim-surround](https://github.com/tpope/vim-surround) 333 | 想要添加包裹符号 (`string` -> `"string"`): 334 | ``` 335 | string 336 | ``` 337 | 按下: `yskw'`: 338 | ``` 339 | 'string' 340 | ``` 341 | 想要修改包裹符号 342 | ``` 343 | 'string' 344 | ``` 345 | 按下: `cs'"`: 346 | ``` 347 | "string" 348 | ``` 349 | 350 | Gif 351 | 352 | #### [vim-subversive](https://github.com/svermeulen/vim-subversive) 353 | 新的操作员: `s`: 354 | 355 | 您可以执行 `s<操作>`来使用用默认的寄存器 (或提供的显式寄存器) 的内容替换运动提供的文本对象。例如,您可以执行 `skw` 将光标下的当前单词替换为当前yank,或执行 `skp` 替换段落,依此类推 356 | 357 | 358 | #### [vim-easy-align](https://github.com/junegunn/vim-easy-align) 359 | 在普通或可视模式下按 `ga` + **符号** 可以根据 **符号**对齐文本 360 | 361 | Gif 362 | 363 | #### [AutoFormat](https://github.com/Chiel92/vim-autoformat) 364 | 按 `\` `f` 开启格式化模式 365 | 366 | #### [vim-markdown-toc (为 Markdown 文件生成目录)](https://github.com/mzlogin/vim-markdown-toc) 367 | 在 `Markdown` 文件中, 按下 `:Gen` 打开菜单,你将会看到可选选项 368 | 369 | Gif 370 | 371 | ### 缓冲区内导航 372 | #### [vim-easy-motion](https://github.com/easymotion/vim-easymotion) 373 | 按 `'` 键和一个 `字母` 跳转至 `字母` (类似 Emacs 的 [AceJump](https://www.emacswiki.org/emacs/AceJump)) 374 | 375 | Gif 376 | 377 | #### [Vista.vim](https://github.com/liuchengxu/vista.vim) 378 | 按 `T` 打开函数与变量列表 379 | 380 | Gif 381 | 382 | #### [vim-signiture - 书签](https://github.com/kshenoy/vim-signature) 383 | | 快捷键 | 行为 | 384 | |-------------|----------------------------| 385 | | `m` | 在当前行添加或删除书签 | 386 | | `m/` | 列出所有书签 | 387 | | `mSPACE` | 在缓冲区中跳转到下一个书签 | 388 | | `mt` | 在当前行添加或删除书签 | 389 | | `ma` | 在当前行添加注释 | 390 | | `ml` | 显示所有的书签 | 391 | | `mi` | 下一个书签 | 392 | | `mn` | 上一个书签 | 393 | | `mC` | 清除一个书签 | 394 | | `mX` | 清除所有书签 | 395 | | `mu` | 将书签往上提一行 | 396 | | `me` | 将书签往下拉一行 | 397 | | `SPC` `g` | 将书签移至任意行 | 398 | 399 | Gif 400 | 401 | ### 查找与替换 402 | #### [Far.vim - 查找与替换](https://github.com/brooth/far.vim) 403 | 按下 `SPACE` `f` `r` 在工作目录中搜索 404 | 405 | Gif 406 | 407 | ### Git 相关 408 | #### [vim-gitgutter](https://github.com/airblade/vim-gitgutter) 409 | | 快捷键 | 行为 | 410 | |-----------------|-----------------------------| 411 | | `H` | **在当前行显示 Git 代码块** | 412 | | `SPACE` `g` `-` | 去往上一个 Git 代码块 | 413 | | `SPACE` `g` `+` | 去往下一个 Git 代码块 | 414 | | `SPACE` `g` `f` | 折叠所有除代码块以外的行 | 415 | 416 | #### [fzf-gitignore](https://github.com/fszymanski/fzf-gitignore) 417 | 按 `Space` `g` `i` 来创建一个 `.gitignore` 文件 418 | 419 | Png 420 | 421 | Png 422 | 423 | ### 其它 424 | #### [vim-calendar](https://github.com/itchyny/calendar.vim) 425 | | 快捷键 | 行为 | 426 | |---------|----------| 427 | | `\` `\` | 显示时钟 | 428 | | `\` `c` | 显示日历 | 429 | 430 | Png 431 | 432 | #### [Goyo - 不会分心地工作](https://github.com/junegunn/goyo.vim) 433 | 按下 `g` `y` 开关 Goyo 434 | 435 | Png 436 | 437 | #### [suda.vim](https://github.com/lambdalisue/suda.vim) 438 | 想要忘记以前痛苦的 `sudo vim ...`? 只需要在 Vim 中执行 `:sudowrite` 或者 `:sw` 439 | 440 | #### [coc-translator](https://github.com/voldikss/coc-translator) 441 | 按下 `ts` 来 **翻译光标所在的单词**. 442 | 443 | Png 444 | 445 | ## 自定义代码片段补全 446 | ### Markdown 447 | | 快捷键 | 创建的文字 | 448 | |--------|------------------| 449 | | `,n` | --- | 450 | | `,b` | **粗体**文字 | 451 | | `,s` | ~~被划去~~的文字 | 452 | | `,i` | *斜体*文字 | 453 | | `,d` | `代码块` | 454 | | `,c` | 大的 `代码块` | 455 | | `,m` | - [ ] 清单 | 456 | | `,p` | 图片 | 457 | | `,a` | [链接]() | 458 | | `,1` | # H1 | 459 | | `,2` | ## H2 | 460 | | `,3` | ### H3 | 461 | | `,4` | #### H4 | 462 | | `,l` | -------- | 463 | 464 | `,f` 去往下一个 `<++>` (占位符) 465 | 466 | `,w` 去往下一个 `<++>` (占位符) 并帮你按下 `Enter` 467 | 468 | ## 一些奇怪的东西 469 | ### 按 `tx` 然后输入你想要的文字 470 | `tx Hello` 471 | ``` 472 | _ _ _ _ 473 | | | | | ___| | | ___ 474 | | |_| |/ _ \ | |/ _ \ 475 | | _ | __/ | | (_) | 476 | |_| |_|\___|_|_|\___/ 477 | ``` 478 | 479 | ### 自定义垂直光标移动 480 | 481 | 此 NeoVim 配置包含了一套对 Colemak 用户量身定制的垂直光标移动, 它位于 `cursor.vim` 中, 并且可以替代 “数字 + 上 / 下” 的案件组合 482 | 483 | 为了将光标向上移至 `x` 行, 可以按下 `[` 键, 并将 Colemak 键盘布局的中间行 (“arstdhneio”) 视为从 1 到 0 的数字, 按所需的数字, 再按下空格键以跳转至 `x` 行之上 484 | 485 | 要向下移动光标, 按 `'` 键而不是 `[` 键, 其余部分相同 486 | 487 | 例: 488 | | 快捷键 | 行为 | 489 | | ----------------------- | --------------------- | 490 | | `[` `a` `o` `o` `SPACE` | 将光标向上移动 100 行 | 491 | | `'` `a` `r` `s` `SPACE` | 将光标向下移动123行 | 492 | | `[` `d` `o` `SPACE` | 将光标向上移动50行 | 493 | 494 | **注意: 目前, 使用此移动方式, 你最多只能垂直移动 199 行!** 495 | -------------------------------------------------------------------------------- /Ultisnips/README.md: -------------------------------------------------------------------------------- 1 | # These are custom snippets that suit my needs 2 | -------------------------------------------------------------------------------- /Ultisnips/c.snippets: -------------------------------------------------------------------------------- 1 | snippet cm "Comment Section" 2 | /* ${0} */ 3 | endsnippet 4 | 5 | snippet st "printf" 6 | printf(${0}); 7 | endsnippet 8 | 9 | snippet inc "Includes" 10 | #include 11 | #include 12 | 13 | endsnippet 14 | -------------------------------------------------------------------------------- /Ultisnips/cs.snippets: -------------------------------------------------------------------------------- 1 | snippet main "Public main class" 2 | public static void Main() 3 | { 4 | System.Console.WriteLine("Hello"); 5 | } 6 | 7 | endsnippet 8 | 9 | snippet st "println" 10 | System.Console.WriteLine(${0}); 11 | endsnippet 12 | -------------------------------------------------------------------------------- /Ultisnips/dart.snippets: -------------------------------------------------------------------------------- 1 | snippet imat "Import Material" 2 | import 'package:flutter/material.dart'; 3 | 4 | endsnippet 5 | 6 | snippet context "BuildContext" i 7 | BuildContext context 8 | endsnippet 9 | 10 | snippet fn "Async Function" 11 | void ${1:func}() { 12 | ${0} 13 | } 14 | 15 | endsnippet 16 | 17 | snippet afn "Async Function" 18 | Future ${1:func}() async { 19 | ${0} 20 | } 21 | endsnippet 22 | 23 | snippet wfunc "Widget Function" 24 | Widget build${1:Widget}() { 25 | return ${0:Container()}; 26 | } 27 | endsnippet 28 | 29 | snippet el "} else {" 30 | } else { 31 | endsnippet 32 | 33 | snippet elif "} else if () {" 34 | } else if (${0}) { 35 | endsnippet 36 | 37 | snippet msa "MaterialStateProperty.all" 38 | MaterialStateProperty.all(${0}), 39 | endsnippet 40 | 41 | snippet msr "MaterialStateProperty.resolveWith" 42 | MaterialStateProperty.resolveWith<${1}>((states) => states.contains(MaterialState.pressed) ? null : null), 43 | endsnippet 44 | 45 | snippet wh "Width and height" 46 | width: ${1}, 47 | height: ${0}, 48 | endsnippet 49 | 50 | snippet iwh "Infinity Width and height" 51 | width: double.infinity, 52 | height: double.infinity, 53 | endsnippet 54 | 55 | snippet oprs "onPressed" 56 | final void Function() onPressed; 57 | endsnippet 58 | 59 | snippet pa "Padding" 60 | padding: EdgeInsets.only(${1:left: ${2:0}}${3:, right: ${4:0}}${5:, top: ${6:0}}${7:, bottom: ${8:0}}), 61 | endsnippet 62 | 63 | snippet paa "Padding All" 64 | padding: EdgeInsets.all(${1:8.0}), 65 | endsnippet 66 | 67 | snippet pah "Padding Horizontal" 68 | padding: EdgeInsets.symmetric(horizontal: ${0:0}), 69 | endsnippet 70 | 71 | snippet pav "Padding Vertical" 72 | padding: EdgeInsets.symmetric(vertical: ${0:0}), 73 | endsnippet 74 | 75 | snippet pat "Padding Top" 76 | padding: EdgeInsets.only(top: ${0:0}), 77 | endsnippet 78 | 79 | snippet pab "Padding Bottom" 80 | padding: EdgeInsets.only(bottom: ${0:0}), 81 | endsnippet 82 | 83 | snippet pal "Padding Left" 84 | padding: EdgeInsets.only(left: ${0:0}), 85 | endsnippet 86 | 87 | snippet par "Padding Right" 88 | padding: EdgeInsets.only(right: ${0:0}), 89 | endsnippet 90 | 91 | snippet mar "Margin" 92 | margin: EdgeInsets.only(${1:left: ${2:0}}${3:, right: ${4:0}}${5:, top: ${6:0}}${7:, bottom: ${8:0}}), 93 | endsnippet 94 | 95 | snippet mara "Margin All" 96 | margin: EdgeInsets.all(${1:8.0}), 97 | endsnippet 98 | 99 | snippet marh "Margin Horizontal" 100 | margin: EdgeInsets.symmetric(horizontal: ${0:0}), 101 | endsnippet 102 | 103 | snippet marv "Margin Vertical" 104 | margin: EdgeInsets.symmetric(vertical: ${0:0}), 105 | endsnippet 106 | 107 | snippet mart "Margin Top" 108 | margin: EdgeInsets.only(top: ${0:0}), 109 | endsnippet 110 | 111 | snippet marb "Margin Bottom" 112 | margin: EdgeInsets.only(bottom: ${0:0}), 113 | endsnippet 114 | 115 | snippet marl "Margin Left" 116 | margin: EdgeInsets.only(left: ${0:0}), 117 | endsnippet 118 | 119 | snippet marr "Margin Right" 120 | margin: EdgeInsets.only(right: ${0:0}), 121 | endsnippet 122 | 123 | snippet marv "Margin Vertical" 124 | margin: EdgeInsets.only(top: ${1:0}, bottom: ${1}),${0} 125 | endsnippet 126 | 127 | snippet br "BorderRadius" 128 | borderRadius: BorderRadius.all(Radius.circular(${0})), 129 | endsnippet 130 | 131 | snippet sbr "Shape with BorderRadius" 132 | shape: RoundedRectangleBorder( 133 | borderRadius: BorderRadius.all(Radius.circular(${0})), 134 | ), 135 | endsnippet 136 | 137 | snippet dur "Duration" 138 | duration: const Duration(milliseconds: ${0}), 139 | endsnippet 140 | 141 | snippet dec "BoxDecoration" 142 | decoration: BoxDecoration( 143 | color: ${1}, 144 | ),${0} 145 | endsnippet 146 | 147 | snippet ba "BorderRadius" 148 | border: Border.all( 149 | width: ${1}, 150 | color: ${2}, 151 | ), 152 | endsnippet 153 | 154 | snippet mai "MainAxis" 155 | mainAxisAlignment: MainAxisAlignment.${0} 156 | endsnippet 157 | 158 | snippet crs "CrossAxis" 159 | crossAxisAlignment: CrossAxisAlignment.${0} 160 | endsnippet 161 | 162 | snippet mainmin "MainAxisSize.min" 163 | mainAxisSize: MainAxisSize.min 164 | endsnippet 165 | 166 | snippet row "Row" 167 | Row(children: [ 168 | ${0} 169 | ]), 170 | endsnippet 171 | 172 | snippet rowa "Row with alignment" 173 | Row( 174 | mainAxisAlignment: MainAxisAlignment.${1:start}, 175 | crossAxisAlignment: CrossAxisAlignment.${2:start}, 176 | children: [ 177 | ${0} 178 | ], 179 | ), 180 | endsnippet 181 | 182 | snippet col "Column" 183 | Column(children: [ 184 | ${0} 185 | ]), 186 | endsnippet 187 | 188 | snippet cola "Column with alignment" 189 | Column( 190 | mainAxisAlignment: MainAxisAlignment.${1:start}, 191 | crossAxisAlignment: CrossAxisAlignment.${2:start}, 192 | children: [ 193 | ${0} 194 | ], 195 | ), 196 | endsnippet 197 | 198 | snippet sta "Stack" 199 | Stack(children: [ 200 | ${0} 201 | ]), 202 | endsnippet 203 | 204 | snippet cs "const SizedBox()" 205 | const SizedBox()${0} 206 | endsnippet 207 | 208 | snippet co "Container" 209 | Container()${0} 210 | endsnippet 211 | 212 | snippet con "Container" 213 | Container( 214 | child: ${0}, 215 | ) 216 | endsnippet 217 | 218 | snippet exp "Expanded" 219 | Expanded( 220 | child: ${0}, 221 | ), 222 | endsnippet 223 | 224 | snippet flx "Flexible" 225 | Flexible( 226 | child: ${0}, 227 | ), 228 | endsnippet 229 | 230 | snippet cons "Container Sized" 231 | Container( 232 | width: ${1}, 233 | height: ${2}, 234 | child: ${0}, 235 | ) 236 | endsnippet 237 | 238 | snippet cen "Center" 239 | Center(child: ${0}) 240 | endsnippet 241 | 242 | snippet t "Text" 243 | Text("${1}"),${0} 244 | endsnippet 245 | 246 | snippet ts "Text with text style" 247 | Text(${1}, style: ${2}),${0} 248 | endsnippet 249 | 250 | snippet rts "Rich Text with text style" 251 | RichText( 252 | text: TextSpan(children: [ 253 | TextSpan(text: ${1}, style: ${2}),${0} 254 | ]), 255 | ), 256 | endsnippet 257 | 258 | snippet ss "TextStyle" 259 | TStyle(c: ${1}, s: ${2:14}, w: F.w${3:5})${0} 260 | endsnippet 261 | 262 | 263 | snippet nbuilder "NotifierBuilder" 264 | NotifierBuilder( 265 | notifier: null, 266 | builder: (context) { 267 | return Container(); 268 | }, 269 | ) 270 | endsnippet 271 | 272 | snippet sw "SizedBox with width" 273 | const SizedBox(width: ${1}),${0} 274 | endsnippet 275 | 276 | snippet sh "SizedBox with height" 277 | const SizedBox(height: ${1}),${0} 278 | endsnippet 279 | 280 | snippet swh "SizedBox with width and height" 281 | SizedBox(width: ${1}, height: ${2}),${0} 282 | endsnippet 283 | 284 | snippet scaf "Scaffold" 285 | Scaffold( 286 | appBar: AppBar( 287 | title: Text('${1:Title}'), 288 | ), 289 | body: ${2:Container()}${0}, 290 | ); 291 | endsnippet 292 | 293 | snippet sf "New Stateful Widget" b 294 | class ${1:name} extends StatefulWidget { 295 | ${1:name}({super.key}); 296 | @override 297 | _${1:WidgetName}State createState() => _${1:WidgetName}State(); 298 | } 299 | class _${1:index}State extends State<${1:index}> { 300 | @override 301 | Widget build(context) { 302 | return ${2:Container()}; 303 | } 304 | } 305 | endsnippet 306 | 307 | 308 | snippet sl "New Stateless Widget" b 309 | class ${1:name} extends StatelessWidget { 310 | ${1:name}({super.key}); 311 | @override 312 | Widget build(context) { 313 | return ${2:Container()}; 314 | } 315 | } 316 | endsnippet 317 | 318 | snippet wt "Colors.white" 319 | color: colorWhite, 320 | endsnippet 321 | 322 | snippet inits "initState" 323 | @override 324 | void initState() { 325 | ${0} 326 | super.initState(); 327 | } 328 | endsnippet 329 | 330 | snippet dispose "dispose" 331 | @override 332 | void dispose() { 333 | ${0:} 334 | super.dispose(); 335 | } 336 | endsnippet 337 | 338 | snippet listv "ListView.builder" 339 | ListView.builder( 340 | itemCount: ${1:1}, 341 | itemBuilder: (context, index) { 342 | return ${2:Container()}; 343 | }, 344 | ) 345 | endsnippet 346 | 347 | snippet future "Future Builder" 348 | FutureBuilder( 349 | future: ${1:Future}, 350 | initialData: ${2:InitialData}, 351 | builder: (context, snapshot) { 352 | if (snapshot.connectionState == ConnectionState.done) 353 | return ${3:Container();} 354 | return ${4:Container();} 355 | }, 356 | ) 357 | endsnippet 358 | 359 | snippet stream "Stream Builder" 360 | StreamBuilder<${1:dynamic}>( 361 | stream: ${2:yourStream}, 362 | builder: (context, snapshot) { 363 | if (snapshot.hasData) { 364 | // TODO: do something with the data 365 | return ${3:Container()}; 366 | } else if (snapshot.hasError) { 367 | // TODO: do something with the error 368 | return ${4:Text(snapshot.error.toString())}; 369 | } 370 | // TODO: the data is not ready, show a loading indicator 371 | return ${5:Center(child: CircularProgressIndicator())}; 372 | }, 373 | ), 374 | endsnippet 375 | 376 | snippet try "try catch" 377 | try { 378 | ${0} 379 | } catch (e, stack) { 380 | print(e); 381 | print(stack); 382 | } 383 | endsnippet 384 | 385 | snippet for "standard for loop without brackets" 386 | for (var ${1:i} = 0; ${1:i} < ${2:n}; ++${1:i}) 387 | ${3:// TODO} 388 | endsnippet 389 | 390 | snippet forr "standard for loop" 391 | for (var ${1:i} = 0; ${1:i} < ${2:n}; ++${1:i}) { 392 | ${3:// TODO} 393 | } 394 | endsnippet 395 | 396 | snippet fori "For in loop" 397 | for (var ${1:item} in ${2:object}) { 398 | ${3:// TODO} 399 | } 400 | endsnippet 401 | 402 | snippet ssm "Multi-line Set State" 403 | setState(() { 404 | ${1:// TODO} 405 | }); 406 | endsnippet 407 | 408 | snippet sss "Single-line Set State" 409 | setState(() => ${1:/* TODO */} ); 410 | endsnippet 411 | 412 | snippet sst "Empty Set State" 413 | setState(() {})${0} 414 | endsnippet 415 | 416 | snippet rf "Request focus" 417 | FocusScope.of(context).requestFocus(${1:FocusNode()})${0} 418 | endsnippet 419 | 420 | snippet rfn "Request focusnode (new)" 421 | FocusScope.of(context).requestFocus(FocusNode()); 422 | endsnippet 423 | 424 | snippet push "Navigator push" 425 | Navigator.of(context).push( 426 | MaterialPageRoute(builder: (context) => ${1:Page()}), 427 | )${0} 428 | endsnippet 429 | 430 | snippet pop "Navigator pop" 431 | Navigator.of(context).pop(${1})${0} 432 | endsnippet 433 | 434 | snippet rmb "RawMaterialButton" 435 | RawMaterialButton( 436 | elevation: ${1:0}, 437 | onPressed: () {}, 438 | shape: RoundedRectangleBorder( 439 | borderRadius: BorderRadius.all(Radius.circular(${2:5})), 440 | ), 441 | fillColor: ${3:Colors.transparent}, 442 | child: ${5:Container()}, 443 | ), 444 | endsnippet 445 | 446 | snippet mo "Get MediaQuery" 447 | MediaQuery.of(context)${0} 448 | endsnippet 449 | 450 | snippet st "print();" 451 | print(${0}); 452 | endsnippet 453 | 454 | snippet sbj "Behavior subject" 455 | Stream<${1:int}> get ${2:my}Stream => _${2:my}Subject.stream; 456 | BehaviorSubject<${1}> _${2:my}Subject; 457 | _${2:my}Subject = BehaviorSubject<${1}>(); 458 | endsnippet 459 | 460 | snippet f "Function" 461 | () => 462 | endsnippet 463 | 464 | snippet adelay "await Future.delayed" 465 | await Future.delayed(const Duration(milliseconds: ${1:300})); 466 | endsnippet 467 | 468 | snippet delay "Future.delayed" 469 | Future.delayed(const Duration(milliseconds: ${1:300})).then((_) { 470 | ${2} 471 | }); 472 | endsnippet 473 | 474 | snippet now "DateTime.now()" 475 | DateTime.now() 476 | endsnippet 477 | 478 | snippet rt "required this." 479 | required this.${1}, ${0} 480 | endsnippet 481 | 482 | snippet posr "Positioned right" 483 | Positioned( 484 | top: ${1:0}, 485 | right: ${2:0}, 486 | bottom: ${3:0}, 487 | child: ${0:Container()}, 488 | ), 489 | endsnippet 490 | 491 | snippet posl "Positioned left" 492 | Positioned( 493 | top: ${1:0}, 494 | left: ${2:0}, 495 | bottom: ${3:0}, 496 | child: ${0:Container()}, 497 | ), 498 | endsnippet 499 | 500 | snippet post "Positioned top" 501 | Positioned( 502 | top: ${1:0}, 503 | left: ${2:0}, 504 | right: ${3:0}, 505 | child: ${0:Container()}, 506 | ), 507 | endsnippet 508 | 509 | snippet posb "Positioned bottom" 510 | Positioned( 511 | bottom: ${1:0}, 512 | left: ${2:0}, 513 | right: ${3:0}, 514 | child: ${0:Container()}, 515 | ), 516 | endsnippet 517 | 518 | snippet postr "Positioned top right" 519 | Positioned( 520 | top: ${1:0}, 521 | right: ${2:0}, 522 | child: ${3:Container()}, 523 | ), 524 | endsnippet 525 | 526 | snippet posbl "Positioned bottom left" 527 | Positioned( 528 | bottom: ${1:0}, 529 | left: ${2:0}, 530 | child: ${3:Container()}, 531 | ), 532 | endsnippet 533 | 534 | snippet posbr "Positioned bottom right" 535 | Positioned( 536 | bottom: ${1:0}, 537 | right: ${2:0}, 538 | child: ${3:Container()}, 539 | ), 540 | endsnippet 541 | 542 | snippet postl "Positioned top left" 543 | Positioned( 544 | top: ${1:0}, 545 | left: ${2:0}, 546 | child: ${3:Container()}, 547 | ), 548 | endsnippet 549 | 550 | snippet fa "fix add type" 551 | // TYPEADD 552 | endsnippet 553 | 554 | snippet .f "fix add type" i 555 | .forEach((${1:item}) { 556 | ${0:// TODO} 557 | }); 558 | endsnippet 559 | -------------------------------------------------------------------------------- /Ultisnips/go.snippets: -------------------------------------------------------------------------------- 1 | snippet checke "Check Error" 2 | if err != nil { 3 | return err 4 | } 5 | ${0} 6 | endsnippet 7 | 8 | snippet no "utils.NoError" 9 | if utils.NoError(err) { 10 | ${0} 11 | } 12 | endsnippet 13 | 14 | snippet forr "For loop range" 15 | for _, ${1:thing} := range ${2:things} { 16 | ${3://TODO} 17 | } 18 | endsnippet 19 | 20 | snippet fori "For loop i" 21 | for i := 0; i < n; i++ { 22 | ${1://TODO} 23 | } 24 | endsnippet 25 | 26 | snippet re "Return Error if any" 27 | if err != nil { 28 | return err 29 | } 30 | ${0} 31 | endsnippet 32 | 33 | snippet ie "Check Error" 34 | if err != nil { 35 | panic(err) 36 | } 37 | ${0} 38 | endsnippet 39 | 40 | snippet st "Println" 41 | fmt.Println(${1})${0} 42 | endsnippet 43 | 44 | snippet lt "Log Println" 45 | log.Println(${1})${0} 46 | endsnippet 47 | 48 | snippet sf "Printf" 49 | fmt.Printf("${1}\n")${0} 50 | endsnippet 51 | 52 | snippet lf "Log Printf" 53 | log.Printf("${1}\n")${0} 54 | endsnippet 55 | 56 | snippet fn "Function" 57 | func ${1:function}() { 58 | ${0: // todo} 59 | } 60 | endsnippet 61 | 62 | snippet lt "Log Println" 63 | log.Println(${1})${0} 64 | endsnippet 65 | 66 | snippet start "Starting code" 67 | package main 68 | 69 | import ( 70 | "fmt" 71 | ) 72 | 73 | func main() { 74 | fmt.Println("hello") 75 | } 76 | endsnippet 77 | 78 | snippet cq "Current Question" 79 | app.result.questions[app.curResultIndex]${0} 80 | endsnippet 81 | 82 | snippet fa "fix add type" 83 | // FIX:ADDTYPE 84 | endsnippet 85 | -------------------------------------------------------------------------------- /Ultisnips/java.snippets: -------------------------------------------------------------------------------- 1 | snippet st "System.out.Println();" 2 | System.out.println(${0}); 3 | endsnippet 4 | 5 | -------------------------------------------------------------------------------- /Ultisnips/javascript.snippets: -------------------------------------------------------------------------------- 1 | snippet st "console.log" 2 | console.log(${0}); 3 | endsnippet 4 | 5 | snippet fl "Firebase Function Log" 6 | /*LOG*/ functions.logger.log(${0}); 7 | endsnippet 8 | 9 | snippet f "Arrow Function" 10 | (${1:arg}) => { 11 | ${0} 12 | } 13 | endsnippet 14 | 15 | snippet fn "Empty Function" 16 | function ${1:functionName}() { 17 | ${0} 18 | } 19 | endsnippet 20 | 21 | snippet cf "Constant Function" 22 | const ${1:funcName} = () => { 23 | ${0} 24 | } 25 | endsnippet 26 | 27 | snippet ef "Export Function" 28 | export function ${1:functionName}() { 29 | ${0} 30 | } 31 | endsnippet 32 | 33 | snippet eaf "Export Async Function" 34 | export async function ${1:functionName}() { 35 | ${0} 36 | } 37 | endsnippet 38 | 39 | snippet eafa "Export Async Function With Args" 40 | const ${1}DefaultArgs = { 41 | ${2} 42 | }; 43 | export async function ${1:functionName}(options = ${1}DefaultArgs) { 44 | options = { ...${1}DefaultArgs, ...options }; 45 | ${0:// todo} 46 | } 47 | endsnippet 48 | 49 | snippet ssr "NextJS ServerSide Rendering" 50 | export async function getServerSideProps() { 51 | return { 52 | props: { 53 | // 54 | }, 55 | }; 56 | } 57 | endsnippet 58 | 59 | snippet ssg "NextJS ServerSide Generation" 60 | export async function getStaticProps() { 61 | return { 62 | props: { 63 | // 64 | }, 65 | }; 66 | } 67 | endsnippet 68 | 69 | snippet rs "res.status" 70 | res.status(${1:200}).send("${2:text}")${0} 71 | endsnippet 72 | 73 | snippet af "Async Arrow Function" 74 | async (${1}) => { 75 | ${0} 76 | } 77 | endsnippet 78 | 79 | snippet afn "Async Function" 80 | async function ${1:FunctionName}() { 81 | ${0} 82 | } 83 | endsnippet 84 | 85 | snippet try "Try Catch" 86 | try { 87 | // 88 | } catch (e) { 89 | console.error(e); 90 | } 91 | endsnippet 92 | 93 | snippet eh "Error Handler" 94 | return await errorHandler(async () => { 95 | ${0:// Todo} 96 | }); 97 | endsnippet 98 | 99 | snippet c "Comment Block" 100 | /* 101 | * ${0} 102 | */ 103 | endsnippet 104 | 105 | snippet pm "@param" 106 | @param ${1:parameter}: ${0:description} 107 | endsnippet 108 | 109 | # React & JSX 110 | 111 | snippet t "Tag" 112 | <${1:div}> 113 | ${2} 114 | 115 | ${0} 116 | endsnippet 117 | 118 | snippet ta "Tag with Attributes" 119 | <${1:div} ${2:className=""}> 120 | ${3} 121 | 122 | ${0} 123 | endsnippet 124 | 125 | snippet ti "Tag Inline" 126 | <${1} /> 127 | ${0} 128 | endsnippet 129 | 130 | snippet br "
" 131 |
132 | endsnippet 133 | 134 | 135 | snippet rrcc "React Redux Class Component" b 136 | import React, { Component } from 'react'; 137 | import PropTypes from 'prop-types'; 138 | import { connect } from 'react-redux'; 139 | import styles from './${2:$1}.css'; 140 | 141 | class ${1:`!v expand('%:t:r')`} extends Component { 142 | static propTypes = { 143 | children: PropTypes.node, 144 | className: PropTypes.string, 145 | dispatch: PropTypes.func.isRequired, 146 | }; 147 | 148 | constructor(props) { 149 | super(props); 150 | } 151 | 152 | render() { 153 | return ( 154 |
155 | $3 156 |
157 | ); 158 | } 159 | } 160 | 161 | function mapStateToProps(state) { 162 | return {}; 163 | } 164 | 165 | export default connect(mapStateToProps)($1); 166 | endsnippet 167 | 168 | snippet rcc "React Class Component" b 169 | import React, { Component } from 'react'; 170 | import PropTypes from 'prop-types'; 171 | import styles from './${2:$1}.css'; 172 | 173 | class ${1:`!v expand('%:t:r')`} extends Component { 174 | static propTypes = { 175 | ${2:children: PropTypes.node, 176 | className: PropTypes.string,} 177 | }; 178 | 179 | constructor(props) { 180 | super(props); 181 | } 182 | 183 | render() { 184 | return ( 185 | <${3:div} className={styles.base}> 186 | $0 187 | 188 | ); 189 | } 190 | } 191 | 192 | export default $1; 193 | endsnippet 194 | 195 | snippet rfc "React Functional Component" b 196 | import React from 'react'; 197 | import PropTypes from 'prop-types'; 198 | import styles from './${2:$1}.css'; 199 | 200 | function ${1:`!v expand('%:t:r')`}({ $3 }) { 201 | return ( 202 | <${5:div} className={styles.base}> 203 | $0 204 | 205 | ); 206 | } 207 | 208 | $1.defaultProps = {$4}; 209 | 210 | $1.propTypes = {`!p 211 | props = t[3] 212 | if props: 213 | snip >> 1 214 | for prop in props.split(', '): 215 | snip += prop + ': PropTypes.any,' 216 | ` 217 | }; 218 | 219 | export default $1; 220 | endsnippet 221 | 222 | snippet rsc "React Styled Component" b 223 | import styled from 'styled-components'; 224 | 225 | const ${1:`!v expand('%:t:r')`} = styled.${2:div}\` 226 | $3 227 | \`; 228 | 229 | export default $1; 230 | endsnippet 231 | 232 | snippet rsci "React Styled Component Interpolation" b 233 | import styled, { css } from 'styled-components'; 234 | 235 | const ${1:`!v expand('%:t:r')`} = styled.${2:div}\`${props => css\` 236 | ${3:${props.$4 && \` 237 | $5 238 | \`}} 239 | \`}\`; 240 | 241 | export default $1; 242 | endsnippet 243 | 244 | snippet pp "Get Props" 245 | ${props => props.${1}}; 246 | endsnippet 247 | 248 | snippet cn "className" 249 | className="$1" 250 | endsnippet 251 | 252 | snippet dp "Default Props" b 253 | ${1:`!v expand('%:t:r')`.}defaultProps = { 254 | $2 255 | }; 256 | endsnippet 257 | 258 | snippet set "Set State" 259 | this.setState({ 260 | ${1}: ${2} 261 | }); 262 | endsnippet 263 | 264 | snippet props "Get Property" i 265 | this.props.${1} 266 | endsnippet 267 | 268 | snippet state "Get State" i 269 | this.state.${1} 270 | endsnippet 271 | 272 | snippet ref "Ref" i 273 | ref={${1:ref} => { this.${2:name} = $1; }} 274 | endsnippet 275 | 276 | 277 | # Component Lifecycle 278 | snippet cwm "Component Will Mount" b 279 | componentWillMount() { 280 | $1 281 | } 282 | endsnippet 283 | 284 | snippet cdm "Component Did Mount" b 285 | componentDidMount() { 286 | $1 287 | } 288 | endsnippet 289 | 290 | snippet cwrp "Component Will Receive Props" b 291 | componentWillReceiveProps(nextProps) { 292 | $1 293 | } 294 | endsnippet 295 | 296 | snippet scup "Should Component Update" b 297 | shouldComponentUpdate(nextProps, nextState) { 298 | $1 299 | } 300 | endsnippet 301 | 302 | snippet cwup "Component Will Update" b 303 | componentWillUpdate(nextProps, nextState) { 304 | $1 305 | } 306 | endsnippet 307 | 308 | snippet cdup "Component Did Update" b 309 | componentDidUpdate(prevProps, prevState) { 310 | $1 311 | } 312 | endsnippet 313 | 314 | snippet cwu "Component Will Unmount" b 315 | componentWillUnmount() { 316 | $1 317 | } 318 | endsnippet 319 | 320 | snippet ren "Render" 321 | render() { 322 | return ${1:( 323 | ${2:
${3}
} 324 | );} 325 | } 326 | endsnippet 327 | 328 | 329 | # PropTypes 330 | snippet pt "PropTypes Definition" b 331 | ${1:`!v expand('%:t:r')`.}propTypes = { 332 | ${2:className}: ${3:PropTypes.string}, 333 | }; 334 | endsnippet 335 | 336 | snippet pt.a "PropTypes Array" w 337 | PropTypes.array${1:,} 338 | endsnippet 339 | 340 | snippet pt.b "PropTypes Boolean" w 341 | PropTypes.bool${1:,} 342 | endsnippet 343 | 344 | snippet pt.f "PropTypes Function" w 345 | PropTypes.func${1:,} 346 | endsnippet 347 | 348 | snippet pt.n "PropTypes Number" w 349 | PropTypes.number${1:,} 350 | endsnippet 351 | 352 | snippet pt.o "PropTypes Object" w 353 | PropTypes.object${1:,} 354 | endsnippet 355 | 356 | snippet pt.s "PropType String" w 357 | PropTypes.string${1:,} 358 | endsnippet 359 | 360 | snippet pt.no "PropTypes Node" w 361 | PropTypes.node${1:,} 362 | endsnippet 363 | 364 | snippet pt.e "PropTypes Element" w 365 | PropTypes.element${1:,} 366 | endsnippet 367 | 368 | snippet pt.io "PropTypes instanceOf" w 369 | PropTypes.instanceOf(${2:PropTypes.string})${1:,} 370 | endsnippet 371 | 372 | snippet pt.one "PropTypes oneOf" w 373 | PropTypes.oneOf(['$2'$3])${1:,} 374 | endsnippet 375 | 376 | snippet pt.onet "PropTypes oneOfType" w 377 | PropTypes.oneOfType([ 378 | $2 379 | ])${1:,} 380 | endsnippet 381 | 382 | snippet pt.ao "PropTypes arrayOf" w 383 | PropTypes.arrayOf(${2:PropTypes.string})${1:,} 384 | endsnippet 385 | 386 | snippet pt.oo "PropTypes objectOf" w 387 | PropTypes.objectOf(${2:PropTypes.string})${1:,} 388 | endsnippet 389 | 390 | snippet pt.sh "PropTyes Shape" w 391 | PropTypes.shape({ 392 | $2 393 | })${1:,} 394 | endsnippet 395 | 396 | snippet ir "isRequired" w 397 | isRequired, 398 | endsnippet 399 | 400 | snippet rs "React useState" 401 | const [$1, set${1}] = useState(${0:''}) 402 | endsnippet 403 | 404 | snippet test "Test" 405 | test("${1:test}", ${2:async}() => { 406 | ${3:// ...} 407 | }); 408 | endsnippet 409 | 410 | snippet ex "Expect" 411 | expect(${1:1+1}).toBe(${2:2}); 412 | endsnippet 413 | 414 | 415 | snippet route "New Route" 416 | import express from "express"; 417 | 418 | const ${1:some}Routes = express.Router(); 419 | 420 | ${0:// TODO} 421 | 422 | export default ${1:some}Routes; 423 | endsnippet 424 | 425 | snippet l "log" 426 | log(${0}); 427 | endsnippet 428 | 429 | snippet ehs "errorHandlers.silent" 430 | await errorHandlers.silent(async () => { 431 | ${0:// todo} 432 | }); 433 | endsnippet 434 | 435 | snippet eha "errorHandlers.safe" 436 | await errorHandlers.safe({ 437 | action: async () => { 438 | ${0:// todo} 439 | }, 440 | teardown: async () => { 441 | // todo 442 | }, 443 | }); 444 | endsnippet 445 | -------------------------------------------------------------------------------- /Ultisnips/markdown.snippets: -------------------------------------------------------------------------------- 1 | snippet th "Table Heading" 2 | | ${1:Key} | ${2:Value} | 3 | |-|-| 4 | ${0} 5 | endsnippet 6 | 7 | snippet tr "Table Row" 8 | | ${1:Term} | ${2:Definition} | 9 | ${0} 10 | endsnippet 11 | -------------------------------------------------------------------------------- /Ultisnips/python.snippets: -------------------------------------------------------------------------------- 1 | snippet st "print" 2 | print(${0}) 3 | endsnippet 4 | 5 | -------------------------------------------------------------------------------- /Ultisnips/racket.snippets: -------------------------------------------------------------------------------- 1 | snippet fn "Function" 2 | (define (${1:name} [${2:arg : Real}]) : Real 3 | ${0:(+ 1 1)}) 4 | endsnippet 5 | 6 | snippet st "print();" 7 | (displayln ${0}) 8 | endsnippet 9 | 10 | -------------------------------------------------------------------------------- /Ultisnips/swift.snippets: -------------------------------------------------------------------------------- 1 | snippet st "print" 2 | print(${0}) 3 | endsnippet 4 | 5 | -------------------------------------------------------------------------------- /Ultisnips/tex.snippets: -------------------------------------------------------------------------------- 1 | # snip 2 | snippet mid "\mid \mid" 3 | \\mid ${1} \\mid ${0} 4 | endsnippet 5 | 6 | snippet srt "\sqrt{}" 7 | \\sqrt{${1}} ${0} 8 | endsnippet 9 | 10 | -------------------------------------------------------------------------------- /Ultisnips/typescriptreact.snippets: -------------------------------------------------------------------------------- 1 | snippet ssg "NextJS ServerSide Generation" 2 | export async function getStaticProps() { 3 | return { 4 | props: { 5 | // 6 | }, 7 | }; 8 | } 9 | endsnippet 10 | 11 | snippet t "Tag" 12 | <${1:div}> 13 | ${2} 14 | 15 | ${0} 16 | endsnippet 17 | 18 | snippet ta "Tag with Attributes" 19 | <${1:div} ${2:className=""}> 20 | ${3} 21 | 22 | ${0} 23 | endsnippet 24 | 25 | snippet tn "Tag with class Names" 26 | <${1:div} className="${2}"> 27 | ${0} 28 | 29 | endsnippet 30 | 31 | snippet ti "Tag Inline" 32 | <${1} /> 33 | ${0} 34 | endsnippet 35 | 36 | snippet br "
" 37 |
38 | endsnippet 39 | -------------------------------------------------------------------------------- /Ultisnips/vim.snippets: -------------------------------------------------------------------------------- 1 | snippet sec "Comment Section" 2 | " === 3 | " === ${1:New Section} 4 | " === 5 | ${0} 6 | endsnippet 7 | 8 | -------------------------------------------------------------------------------- /coc-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "coc.preferences.semanticTokensHighlights": false, 3 | "coc.preferences.enableFloatHighlight": true, 4 | "coc.preferences.snippetStatusText": "Ⓢ ", 5 | "coc.preferences.extensionUpdateCheck": "daily", 6 | "coc.preferences.messageLevel": "error", 7 | "coc.source.around.firstMatch": false, 8 | "coc.source.buffer.firstMatch": false, 9 | "coc.source.syntax.firstMatch": false, 10 | "suggest.detailMaxLength": 60, 11 | "suggest.noselect": true, 12 | "suggest.enablePreselect": false, 13 | "suggest.triggerAfterInsertEnter": true, 14 | "suggest.autoTrigger": "always", 15 | "suggest.timeout": 5000, 16 | "suggest.enablePreview": true, 17 | "suggest.floatEnable": true, 18 | "suggest.detailField": "preview", 19 | "suggest.snippetIndicator": "", 20 | "suggest.triggerCompletionWait": 100, 21 | "suggest.echodocSupport": true, 22 | "suggest.completionItemKindLabels": { 23 | "class": "\uf0e8", 24 | "color": "\ue22b", 25 | "constant": "\uf8fe", 26 | "default": "\uf29c", 27 | "enum": "\uf435", 28 | "enumMember": "\uf02b", 29 | "event": "\ufacd", 30 | "field": "\uf93d", 31 | "file": "\uf723", 32 | "folder": "\uf115", 33 | "function": "\u0192", 34 | "interface": "\uf417", 35 | "keyword": "\uf1de", 36 | "method": "\uf6a6", 37 | "module": "\uf40d", 38 | "operator": "\uf915", 39 | "property": "\ue624", 40 | "reference": "\ufa46", 41 | "snippet": "\ue60b", 42 | "struct": "\ufb44", 43 | "text": "\ue612", 44 | "typeParameter": "\uf728", 45 | "unit": "\uf475", 46 | "value": "\uf89f", 47 | "variable": "\ue71b" 48 | }, 49 | "diagnostic.signOffset": 1, 50 | "diagnostic.errorSign": "\uf467", 51 | "diagnostic.warningSign": "\uf071", 52 | "diagnostic.infoSign": "\uf129", 53 | "diagnostic.hintSign": "\uf864", 54 | "diagnostic.displayByAle": false, 55 | "diagnostic.refreshOnInsertMode": false, 56 | "diagnostic.checkCurrentLine": true, 57 | "diagnostic.virtualTextPrefix": " ❯❯❯ ", 58 | "diagnostic.virtualText": false, 59 | "codeLens.enable": true, 60 | "list.previewHighlightGroup": "Statement", 61 | "list.nextKeymap": "", 62 | "list.previousKeymap": "", 63 | "importCost.bundleSizeDecoration": "both", 64 | "importCost.typescriptExtensions": ["\\.tsx?$"], 65 | "importCost.javascriptExtensions": ["\\.jsx?$"], 66 | "importCost.showCalculatingDecoration": true, 67 | "importCost.debug": false, 68 | "snippets.ultisnips.directories": [ 69 | "$HOME/.config/nvim/Ultisnips/", 70 | "$HOME/.config/nvim/plugged/vim-snippets/UltiSnips/" 71 | ], 72 | "coc.preferences.formatOnSaveFiletypes": [ 73 | "javascript", 74 | "typescript", 75 | "typescriptreact", 76 | "html", 77 | "css", 78 | "json", 79 | "jsonc", 80 | "java", 81 | "python", 82 | "vue", 83 | "svelte", 84 | "c", 85 | "cpp", 86 | "cs", 87 | "racket", 88 | "prisma", 89 | "dart", 90 | "terraform" 91 | ], 92 | "yaml.format.enable": true, 93 | "signature.target": "float", 94 | "yank.enableCompletion": false, 95 | "typescript.suggestionActions.enabled": true, 96 | "typescript.format.enabled": true, 97 | "jest.watch": false, 98 | "explorer.width": 38, 99 | "explorer.quitOnOpen": true, 100 | "explorer.sources": [ 101 | { 102 | "name": "buffer", 103 | "expand": false 104 | }, 105 | { 106 | "name": "file", 107 | "expand": true 108 | } 109 | ], 110 | "explorer.file.column.indent.indentLine": true, 111 | "explorer.file.showHiddenFiles": true, 112 | "explorer.icon.enableNerdfont": true, 113 | "explorer.file.column.git.showIgnored": true, 114 | "explorer.keyMappingMode": "none", 115 | "explorer.buffer.showHiddenBuffers": false, 116 | "explorer.keyMappings.global": { 117 | "u": "nodePrev", 118 | "e": "nodeNext", 119 | "h": "toggleSelection", 120 | "": "actionMenu", 121 | "gl": "expandRecursive", 122 | "gh": "collapseRecursive", 123 | "i": ["wait", "expandable?", "expand", "open"], 124 | "": ["wait", "expandable?", "cd", "open"], 125 | "I": "open:vsplit", 126 | "o": ["wait", "expanded?", "collapse", "expand"], 127 | "O": "open:tab", 128 | "n": "collapse", 129 | "l": "gotoParent", 130 | "yp": "copyFilepath", 131 | "yn": "copyFilename", 132 | "yy": "copyFile", 133 | "dd": "cutFile", 134 | "pp": "pasteFile", 135 | "dD": "deleteForever", 136 | "a": "addFile", 137 | "k": "addFile", 138 | "M": "addDirectory", 139 | "cw": "rename", 140 | ".": "toggleHidden", 141 | "zh": "toggleHidden", 142 | "R": "refresh", 143 | "?": "help", 144 | "q": "quit", 145 | "X": "systemExecute", 146 | "gd": "listDrive", 147 | "f": "search", 148 | "F": "searchRecursive", 149 | "B": "gotoSource:file", 150 | "b": "gotoSource:buffer", 151 | "[[": "sourcePrev", 152 | "]]": "sourceNext", 153 | "[d": "diagnosticPrev", 154 | "]d": "diagnosticNext", 155 | "[c": "gitPrev", 156 | "]c": "gitNext", 157 | "<<": "gitStage", 158 | ">>": "gitUnstage" 159 | }, 160 | "flutter.outlineWidth": 40, 161 | "flutter.outlineIconPadding": 0, 162 | "flutter.UIPath": true, 163 | "flutter.openDevLogSplitCommand": "botright 12split", 164 | "flutter.lsp.initialization.onlyAnalyzeProjectsWithOpenFiles": false, 165 | "flutter.trace.server": "off", 166 | "dart.lineLength": 100, 167 | "tslint.autoFixOnSave": false, 168 | "python.autoComplete.addBrackets": true, 169 | "python.jediEnabled": false, 170 | "python.formatting.provider": "yapf", 171 | "python.formatting.yapfArgs": [ 172 | "--style", 173 | "{SPACES_AROUND_POWER_OPERATOR: True, SPACES_BEFORE_COMMENT: 1}" 174 | ], 175 | "html.format.enable": true, 176 | "javascript.referencesCodeLens.enable": true, 177 | "javascript.showUnused": true, 178 | "javascript.suggest.names": true, 179 | "javascript.suggestionActions.enabled": true, 180 | "json.format.enable": true, 181 | "eslint.autoFixOnSave": false, 182 | "prettier.printWidth": 100, 183 | "prettier.disableLanguages": [], 184 | "prettier.formatterPriority": 1, 185 | "prettier.useTabs": true, 186 | "prettier.trailingComma": "all", 187 | "prettier.singleQuote": false, 188 | "todolist.autoUpload": true, 189 | "todolist.promptForReminder": false, 190 | "coc-actions.hideCursor": false, 191 | "coc-actions.showActionKind": true, 192 | "diagnostic-languageserver.filetypes": { 193 | "vim": "vint", 194 | "email": "languagetool", 195 | "markdown": ["write-good", "markdownlint"], 196 | "sh": "shellcheck", 197 | "elixir": ["mix_credo", "mix_credo_compile"], 198 | "eelixir": ["mix_credo", "mix_credo_compile"], 199 | "php": ["phpstan", "psalm"] 200 | }, 201 | "diagnostic-languageserver.formatFiletypes": { 202 | "elixir": "mix_format", 203 | "eelixir": "mix_format" 204 | }, 205 | "languageserver": { 206 | "lua": { 207 | "command": "lua-lsp", 208 | "filetypes": ["lua"] 209 | }, 210 | "swift": { 211 | "command": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp", 212 | "args": [], 213 | "filetypes": ["swift"], 214 | "initializationOptions": {}, 215 | "settings": {} 216 | }, 217 | "golang": { 218 | "command": "gopls", 219 | "rootPatterns": ["go.mod"], 220 | "filetypes": ["go"], 221 | "initializationOptions": { 222 | "gocodeCompletionEnabled": true, 223 | "diagnosticsEnabled": true, 224 | "lintTool": "golint" 225 | } 226 | }, 227 | "bash": { 228 | "command": "bash-language-server", 229 | "args": ["start"], 230 | "filetypes": ["sh"], 231 | "ignoredRootPaths": [] 232 | }, 233 | "racket": { 234 | "command": "racket", 235 | "args": ["--lib", "racket-langserver"], 236 | "filetypes": ["scheme", "racket"] 237 | }, 238 | "terraform": { 239 | "command": "terraform-ls", 240 | "args": ["serve"], 241 | "filetypes": ["terraform", "tf"], 242 | "initializationOptions": {}, 243 | "settings": {} 244 | }, 245 | "ccls": { 246 | "command": "ccls", 247 | "filetypes": ["c", "cpp", "cuda", "objc", "objcpp"], 248 | "rootPatterns": [".ccls", ".ccls-root", "compile_commands.json", ".git/", ".hg/"], 249 | "initializationOptions": { 250 | "cache": { 251 | "directory": "/tmp/ccls" 252 | } 253 | } 254 | } 255 | } 256 | } 257 | -------------------------------------------------------------------------------- /cursor.vim: -------------------------------------------------------------------------------- 1 | " interestind stess 2 | noremap [a 1k 3 | noremap [r 2k 4 | noremap [s 3k 5 | noremap [t 4k 6 | noremap [d 5k 7 | noremap [h 6k 8 | noremap [n 7k 9 | noremap [e 8k 10 | noremap [i 9k 11 | noremap [ao 10k 12 | noremap [aa 11k 13 | noremap [ar 12k 14 | noremap [as 13k 15 | noremap [at 14k 16 | noremap [ad 15k 17 | noremap [ah 16k 18 | noremap [an 17k 19 | noremap [ae 18k 20 | noremap [ai 19k 21 | noremap [ro 20k 22 | noremap [ra 21k 23 | noremap [rr 22k 24 | noremap [rs 23k 25 | noremap [rt 24k 26 | noremap [rd 25k 27 | noremap [rh 26k 28 | noremap [rn 27k 29 | noremap [re 28k 30 | noremap [ri 29k 31 | noremap [so 30k 32 | noremap [sa 31k 33 | noremap [sr 32k 34 | noremap [ss 33k 35 | noremap [st 34k 36 | noremap [sd 35k 37 | noremap [sh 36k 38 | noremap [sn 37k 39 | noremap [se 38k 40 | noremap [si 39k 41 | noremap [to 40k 42 | noremap [ta 41k 43 | noremap [tr 42k 44 | noremap [ts 43k 45 | noremap [tt 44k 46 | noremap [td 45k 47 | noremap [th 46k 48 | noremap [tn 47k 49 | noremap [te 48k 50 | noremap [ti 49k 51 | noremap [do 50k 52 | noremap [da 51k 53 | noremap [dr 52k 54 | noremap [ds 53k 55 | noremap [dt 54k 56 | noremap [dd 55k 57 | noremap [dh 56k 58 | noremap [dn 57k 59 | noremap [de 58k 60 | noremap [di 59k 61 | noremap [ho 60k 62 | noremap [ha 61k 63 | noremap [hr 62k 64 | noremap [hs 63k 65 | noremap [ht 64k 66 | noremap [hd 65k 67 | noremap [hh 66k 68 | noremap [hn 67k 69 | noremap [he 68k 70 | noremap [hi 69k 71 | noremap [no 70k 72 | noremap [na 71k 73 | noremap [nr 72k 74 | noremap [ns 73k 75 | noremap [nt 74k 76 | noremap [nd 75k 77 | noremap [nh 76k 78 | noremap [nn 77k 79 | noremap [ne 78k 80 | noremap [ni 79k 81 | noremap [eo 80k 82 | noremap [ea 81k 83 | noremap [er 82k 84 | noremap [es 83k 85 | noremap [et 84k 86 | noremap [ed 85k 87 | noremap [eh 86k 88 | noremap [en 87k 89 | noremap [ee 88k 90 | noremap [ei 89k 91 | noremap [io 90k 92 | noremap [ia 91k 93 | noremap [ir 92k 94 | noremap [is 93k 95 | noremap [it 94k 96 | noremap [id 95k 97 | noremap [ih 96k 98 | noremap [in 97k 99 | noremap [ie 98k 100 | noremap [ii 99k 101 | noremap [aoo 100k 102 | noremap [aoa 101k 103 | noremap [aor 102k 104 | noremap [aos 103k 105 | noremap [aot 104k 106 | noremap [aod 105k 107 | noremap [aoh 106k 108 | noremap [aon 107k 109 | noremap [aoe 108k 110 | noremap [aoi 109k 111 | noremap [aao 110k 112 | noremap [aaa 111k 113 | noremap [aar 112k 114 | noremap [aas 113k 115 | noremap [aat 114k 116 | noremap [aad 115k 117 | noremap [aah 116k 118 | noremap [aan 117k 119 | noremap [aae 118k 120 | noremap [aai 119k 121 | noremap [aro 120k 122 | noremap [ara 121k 123 | noremap [arr 122k 124 | noremap [ars 123k 125 | noremap [art 124k 126 | noremap [ard 125k 127 | noremap [arh 126k 128 | noremap [arn 127k 129 | noremap [are 128k 130 | noremap [ari 129k 131 | noremap [aso 130k 132 | noremap [asa 131k 133 | noremap [asr 132k 134 | noremap [ass 133k 135 | noremap [ast 134k 136 | noremap [asd 135k 137 | noremap [ash 136k 138 | noremap [asn 137k 139 | noremap [ase 138k 140 | noremap [asi 139k 141 | noremap [ato 140k 142 | noremap [ata 141k 143 | noremap [atr 142k 144 | noremap [ats 143k 145 | noremap [att 144k 146 | noremap [atd 145k 147 | noremap [ath 146k 148 | noremap [atn 147k 149 | noremap [ate 148k 150 | noremap [ati 149k 151 | noremap [ado 150k 152 | noremap [ada 151k 153 | noremap [adr 152k 154 | noremap [ads 153k 155 | noremap [adt 154k 156 | noremap [add 155k 157 | noremap [adh 156k 158 | noremap [adn 157k 159 | noremap [ade 158k 160 | noremap [adi 159k 161 | noremap [aho 160k 162 | noremap [aha 161k 163 | noremap [ahr 162k 164 | noremap [ahs 163k 165 | noremap [aht 164k 166 | noremap [ahd 165k 167 | noremap [ahh 166k 168 | noremap [ahn 167k 169 | noremap [ahe 168k 170 | noremap [ahi 169k 171 | noremap [ano 170k 172 | noremap [ana 171k 173 | noremap [anr 172k 174 | noremap [ans 173k 175 | noremap [ant 174k 176 | noremap [and 175k 177 | noremap [anh 176k 178 | noremap [ann 177k 179 | noremap [ane 178k 180 | noremap [ani 179k 181 | noremap [aeo 180k 182 | noremap [aea 181k 183 | noremap [aer 182k 184 | noremap [aes 183k 185 | noremap [aet 184k 186 | noremap [aed 185k 187 | noremap [aeh 186k 188 | noremap [aen 187k 189 | noremap [aee 188k 190 | noremap [aei 189k 191 | noremap [aio 190k 192 | noremap [aia 191k 193 | noremap [air 192k 194 | noremap [ais 193k 195 | noremap [ait 194k 196 | noremap [aid 195k 197 | noremap [aih 196k 198 | noremap [ain 197k 199 | noremap [aie 198k 200 | noremap [aii 199k 201 | 202 | noremap 'a 1j 203 | noremap 'r 2j 204 | noremap 's 3j 205 | noremap 't 4j 206 | noremap 'd 5j 207 | noremap 'h 6j 208 | noremap 'n 7j 209 | noremap 'e 8j 210 | noremap 'i 9j 211 | noremap 'ao 10j 212 | noremap 'aa 11j 213 | noremap 'ar 12j 214 | noremap 'as 13j 215 | noremap 'at 14j 216 | noremap 'ad 15j 217 | noremap 'ah 16j 218 | noremap 'an 17j 219 | noremap 'ae 18j 220 | noremap 'ai 19j 221 | noremap 'ro 20j 222 | noremap 'ra 21j 223 | noremap 'rr 22j 224 | noremap 'rs 23j 225 | noremap 'rt 24j 226 | noremap 'rd 25j 227 | noremap 'rh 26j 228 | noremap 'rn 27j 229 | noremap 're 28j 230 | noremap 'ri 29j 231 | noremap 'so 30j 232 | noremap 'sa 31j 233 | noremap 'sr 32j 234 | noremap 'ss 33j 235 | noremap 'st 34j 236 | noremap 'sd 35j 237 | noremap 'sh 36j 238 | noremap 'sn 37j 239 | noremap 'se 38j 240 | noremap 'si 39j 241 | noremap 'to 40j 242 | noremap 'ta 41j 243 | noremap 'tr 42j 244 | noremap 'ts 43j 245 | noremap 'tt 44j 246 | noremap 'td 45j 247 | noremap 'th 46j 248 | noremap 'tn 47j 249 | noremap 'te 48j 250 | noremap 'ti 49j 251 | noremap 'do 50j 252 | noremap 'da 51j 253 | noremap 'dr 52j 254 | noremap 'ds 53j 255 | noremap 'dt 54j 256 | noremap 'dd 55j 257 | noremap 'dh 56j 258 | noremap 'dn 57j 259 | noremap 'de 58j 260 | noremap 'di 59j 261 | noremap 'ho 60j 262 | noremap 'ha 61j 263 | noremap 'hr 62j 264 | noremap 'hs 63j 265 | noremap 'ht 64j 266 | noremap 'hd 65j 267 | noremap 'hh 66j 268 | noremap 'hn 67j 269 | noremap 'he 68j 270 | noremap 'hi 69j 271 | noremap 'no 70j 272 | noremap 'na 71j 273 | noremap 'nr 72j 274 | noremap 'ns 73j 275 | noremap 'nt 74j 276 | noremap 'nd 75j 277 | noremap 'nh 76j 278 | noremap 'nn 77j 279 | noremap 'ne 78j 280 | noremap 'ni 79j 281 | noremap 'eo 80j 282 | noremap 'ea 81j 283 | noremap 'er 82j 284 | noremap 'es 83j 285 | noremap 'et 84j 286 | noremap 'ed 85j 287 | noremap 'eh 86j 288 | noremap 'en 87j 289 | noremap 'ee 88j 290 | noremap 'ei 89j 291 | noremap 'io 90j 292 | noremap 'ia 91j 293 | noremap 'ir 92j 294 | noremap 'is 93j 295 | noremap 'it 94j 296 | noremap 'id 95j 297 | noremap 'ih 96j 298 | noremap 'in 97j 299 | noremap 'ie 98j 300 | noremap 'ii 99j 301 | noremap 'aoo 100j 302 | noremap 'aoa 101j 303 | noremap 'aor 102j 304 | noremap 'aos 103j 305 | noremap 'aot 104j 306 | noremap 'aod 105j 307 | noremap 'aoh 106j 308 | noremap 'aon 107j 309 | noremap 'aoe 108j 310 | noremap 'aoi 109j 311 | noremap 'aao 110j 312 | noremap 'aaa 111j 313 | noremap 'aar 112j 314 | noremap 'aas 113j 315 | noremap 'aat 114j 316 | noremap 'aad 115j 317 | noremap 'aah 116j 318 | noremap 'aan 117j 319 | noremap 'aae 118j 320 | noremap 'aai 119j 321 | noremap 'aro 120j 322 | noremap 'ara 121j 323 | noremap 'arr 122j 324 | noremap 'ars 123j 325 | noremap 'art 124j 326 | noremap 'ard 125j 327 | noremap 'arh 126j 328 | noremap 'arn 127j 329 | noremap 'are 128j 330 | noremap 'ari 129j 331 | noremap 'aso 130j 332 | noremap 'asa 131j 333 | noremap 'asr 132j 334 | noremap 'ass 133j 335 | noremap 'ast 134j 336 | noremap 'asd 135j 337 | noremap 'ash 136j 338 | noremap 'asn 137j 339 | noremap 'ase 138j 340 | noremap 'asi 139j 341 | noremap 'ato 140j 342 | noremap 'ata 141j 343 | noremap 'atr 142j 344 | noremap 'ats 143j 345 | noremap 'att 144j 346 | noremap 'atd 145j 347 | noremap 'ath 146j 348 | noremap 'atn 147j 349 | noremap 'ate 148j 350 | noremap 'ati 149j 351 | noremap 'ado 150j 352 | noremap 'ada 151j 353 | noremap 'adr 152j 354 | noremap 'ads 153j 355 | noremap 'adt 154j 356 | noremap 'add 155j 357 | noremap 'adh 156j 358 | noremap 'adn 157j 359 | noremap 'ade 158j 360 | noremap 'adi 159j 361 | noremap 'aho 160j 362 | noremap 'aha 161j 363 | noremap 'ahr 162j 364 | noremap 'ahs 163j 365 | noremap 'aht 164j 366 | noremap 'ahd 165j 367 | noremap 'ahh 166j 368 | noremap 'ahn 167j 369 | noremap 'ahe 168j 370 | noremap 'ahi 169j 371 | noremap 'ano 170j 372 | noremap 'ana 171j 373 | noremap 'anr 172j 374 | noremap 'ans 173j 375 | noremap 'ant 174j 376 | noremap 'and 175j 377 | noremap 'anh 176j 378 | noremap 'ann 177j 379 | noremap 'ane 178j 380 | noremap 'ani 179j 381 | noremap 'aeo 180j 382 | noremap 'aea 181j 383 | noremap 'aer 182j 384 | noremap 'aes 183j 385 | noremap 'aet 184j 386 | noremap 'aed 185j 387 | noremap 'aeh 186j 388 | noremap 'aen 187j 389 | noremap 'aee 188j 390 | noremap 'aei 189j 391 | noremap 'aio 190j 392 | noremap 'aia 191j 393 | noremap 'air 192j 394 | noremap 'ais 193j 395 | noremap 'ait 194j 396 | noremap 'aid 195j 397 | noremap 'aih 196j 398 | noremap 'ain 197j 399 | noremap 'aie 198j 400 | noremap 'aii 199j 401 | -------------------------------------------------------------------------------- /cursor_for_qwerty.vim: -------------------------------------------------------------------------------- 1 | " interestind stess 2 | noremap [a 1k 3 | noremap [s 2k 4 | noremap [d 3k 5 | noremap [f 4k 6 | noremap [g 5k 7 | noremap [h 6k 8 | noremap [j 7k 9 | noremap [k 8k 10 | noremap [l 9k 11 | noremap [a; 10k 12 | noremap [aa 11k 13 | noremap [as 12k 14 | noremap [ad 13k 15 | noremap [af 14k 16 | noremap [ag 15k 17 | noremap [ah 16k 18 | noremap [aj 17k 19 | noremap [ak 18k 20 | noremap [al 19k 21 | noremap [s; 20k 22 | noremap [sa 21k 23 | noremap [ss 22k 24 | noremap [sd 23k 25 | noremap [sf 24k 26 | noremap [sg 25k 27 | noremap [sh 26k 28 | noremap [sj 27k 29 | noremap [sk 28k 30 | noremap [sl 29k 31 | noremap [d; 30k 32 | noremap [da 31k 33 | noremap [ds 32k 34 | noremap [dd 33k 35 | noremap [df 34k 36 | noremap [dg 35k 37 | noremap [dh 36k 38 | noremap [dj 37k 39 | noremap [dk 38k 40 | noremap [dl 39k 41 | noremap [f; 40k 42 | noremap [fa 41k 43 | noremap [fs 42k 44 | noremap [fd 43k 45 | noremap [ff 44k 46 | noremap [fg 45k 47 | noremap [fh 46k 48 | noremap [fj 47k 49 | noremap [fk 48k 50 | noremap [fl 49k 51 | noremap [g; 50k 52 | noremap [ga 51k 53 | noremap [gs 52k 54 | noremap [gd 53k 55 | noremap [gf 54k 56 | noremap [gg 55k 57 | noremap [gh 56k 58 | noremap [gj 57k 59 | noremap [gk 58k 60 | noremap [gl 59k 61 | noremap [h; 60k 62 | noremap [ha 61k 63 | noremap [hs 62k 64 | noremap [hd 63k 65 | noremap [hf 64k 66 | noremap [hg 65k 67 | noremap [hh 66k 68 | noremap [hj 67k 69 | noremap [hk 68k 70 | noremap [hl 69k 71 | noremap [j; 70k 72 | noremap [ja 71k 73 | noremap [js 72k 74 | noremap [jd 73k 75 | noremap [jf 74k 76 | noremap [jg 75k 77 | noremap [jh 76k 78 | noremap [jj 77k 79 | noremap [jk 78k 80 | noremap [jl 79k 81 | noremap [k; 80k 82 | noremap [ka 81k 83 | noremap [ks 82k 84 | noremap [kd 83k 85 | noremap [kf 84k 86 | noremap [kg 85k 87 | noremap [kh 86k 88 | noremap [kj 87k 89 | noremap [kk 88k 90 | noremap [kl 89k 91 | noremap [l; 90k 92 | noremap [la 91k 93 | noremap [ls 92k 94 | noremap [ld 93k 95 | noremap [lf 94k 96 | noremap [lg 95k 97 | noremap [lh 96k 98 | noremap [lj 97k 99 | noremap [lk 98k 100 | noremap [ll 99k 101 | noremap [a;; 100k 102 | noremap [a;a 101k 103 | noremap [a;s 102k 104 | noremap [a;d 103k 105 | noremap [a;f 104k 106 | noremap [a;g 105k 107 | noremap [a;h 106k 108 | noremap [a;j 107k 109 | noremap [a;k 108k 110 | noremap [a;l 109k 111 | noremap [aa; 110k 112 | noremap [aaa 111k 113 | noremap [aas 112k 114 | noremap [aad 113k 115 | noremap [aaf 114k 116 | noremap [aag 115k 117 | noremap [aah 116k 118 | noremap [aaj 117k 119 | noremap [aak 118k 120 | noremap [aal 119k 121 | noremap [as; 120k 122 | noremap [asa 121k 123 | noremap [ass 122k 124 | noremap [asd 123k 125 | noremap [asf 124k 126 | noremap [asg 125k 127 | noremap [ash 126k 128 | noremap [asj 127k 129 | noremap [ask 128k 130 | noremap [asl 129k 131 | noremap [ad; 130k 132 | noremap [ada 131k 133 | noremap [ads 132k 134 | noremap [add 133k 135 | noremap [adf 134k 136 | noremap [adg 135k 137 | noremap [adh 136k 138 | noremap [adj 137k 139 | noremap [adk 138k 140 | noremap [adl 139k 141 | noremap [af; 140k 142 | noremap [afa 141k 143 | noremap [afs 142k 144 | noremap [afd 143k 145 | noremap [aff 144k 146 | noremap [afg 145k 147 | noremap [afh 146k 148 | noremap [afj 147k 149 | noremap [afk 148k 150 | noremap [afl 149k 151 | noremap [ag; 150k 152 | noremap [aga 151k 153 | noremap [ags 152k 154 | noremap [agd 153k 155 | noremap [agf 154k 156 | noremap [agg 155k 157 | noremap [agh 156k 158 | noremap [agj 157k 159 | noremap [agk 158k 160 | noremap [agl 159k 161 | noremap [ah; 160k 162 | noremap [aha 161k 163 | noremap [ahs 162k 164 | noremap [ahd 163k 165 | noremap [ahf 164k 166 | noremap [ahg 165k 167 | noremap [ahh 166k 168 | noremap [ahj 167k 169 | noremap [ahk 168k 170 | noremap [ahl 169k 171 | noremap [aj; 170k 172 | noremap [aja 171k 173 | noremap [ajs 172k 174 | noremap [ajd 173k 175 | noremap [ajf 174k 176 | noremap [ajg 175k 177 | noremap [ajh 176k 178 | noremap [ajj 177k 179 | noremap [ajk 178k 180 | noremap [ajl 179k 181 | noremap [ak; 180k 182 | noremap [aka 181k 183 | noremap [aks 182k 184 | noremap [akd 183k 185 | noremap [akf 184k 186 | noremap [akg 185k 187 | noremap [akh 186k 188 | noremap [akj 187k 189 | noremap [akk 188k 190 | noremap [akl 189k 191 | noremap [al; 190k 192 | noremap [ala 191k 193 | noremap [als 192k 194 | noremap [ald 193k 195 | noremap [alf 194k 196 | noremap [alg 195k 197 | noremap [alh 196k 198 | noremap [alj 197k 199 | noremap [alk 198k 200 | noremap [all 199k 201 | 202 | noremap 'a 1j 203 | noremap 's 2j 204 | noremap 'd 3j 205 | noremap 'f 4j 206 | noremap 'g 5j 207 | noremap 'h 6j 208 | noremap 'j 7j 209 | noremap 'k 8j 210 | noremap 'l 9j 211 | noremap 'a; 10j 212 | noremap 'aa 11j 213 | noremap 'as 12j 214 | noremap 'ad 13j 215 | noremap 'af 14j 216 | noremap 'ag 15j 217 | noremap 'ah 16j 218 | noremap 'aj 17j 219 | noremap 'ak 18j 220 | noremap 'al 19j 221 | noremap 's; 20j 222 | noremap 'sa 21j 223 | noremap 'ss 22j 224 | noremap 'sd 23j 225 | noremap 'sf 24j 226 | noremap 'sg 25j 227 | noremap 'sh 26j 228 | noremap 'sj 27j 229 | noremap 'sk 28j 230 | noremap 'sl 29j 231 | noremap 'd; 30j 232 | noremap 'da 31j 233 | noremap 'ds 32j 234 | noremap 'dd 33j 235 | noremap 'df 34j 236 | noremap 'dg 35j 237 | noremap 'dh 36j 238 | noremap 'dj 37j 239 | noremap 'dk 38j 240 | noremap 'dl 39j 241 | noremap 'f; 40j 242 | noremap 'fa 41j 243 | noremap 'fs 42j 244 | noremap 'fd 43j 245 | noremap 'ff 44j 246 | noremap 'fg 45j 247 | noremap 'fh 46j 248 | noremap 'fj 47j 249 | noremap 'fk 48j 250 | noremap 'fl 49j 251 | noremap 'g; 50j 252 | noremap 'ga 51j 253 | noremap 'gs 52j 254 | noremap 'gd 53j 255 | noremap 'gf 54j 256 | noremap 'gg 55j 257 | noremap 'gh 56j 258 | noremap 'gj 57j 259 | noremap 'gk 58j 260 | noremap 'gl 59j 261 | noremap 'h; 60j 262 | noremap 'ha 61j 263 | noremap 'hs 62j 264 | noremap 'hd 63j 265 | noremap 'hf 64j 266 | noremap 'hg 65j 267 | noremap 'hh 66j 268 | noremap 'hj 67j 269 | noremap 'hk 68j 270 | noremap 'hl 69j 271 | noremap 'j; 70j 272 | noremap 'ja 71j 273 | noremap 'js 72j 274 | noremap 'jd 73j 275 | noremap 'jf 74j 276 | noremap 'jg 75j 277 | noremap 'jh 76j 278 | noremap 'jj 77j 279 | noremap 'jk 78j 280 | noremap 'jl 79j 281 | noremap 'k; 80j 282 | noremap 'ka 81j 283 | noremap 'ks 82j 284 | noremap 'kd 83j 285 | noremap 'kf 84j 286 | noremap 'kg 85j 287 | noremap 'kh 86j 288 | noremap 'kj 87j 289 | noremap 'kk 88j 290 | noremap 'kl 89j 291 | noremap 'l; 90j 292 | noremap 'la 91j 293 | noremap 'ls 92j 294 | noremap 'ld 93j 295 | noremap 'lf 94j 296 | noremap 'lg 95j 297 | noremap 'lh 96j 298 | noremap 'lj 97j 299 | noremap 'lk 98j 300 | noremap 'll 99j 301 | noremap 'a;; 100j 302 | noremap 'a;a 101j 303 | noremap 'a;s 102j 304 | noremap 'a;d 103j 305 | noremap 'a;f 104j 306 | noremap 'a;g 105j 307 | noremap 'a;h 106j 308 | noremap 'a;j 107j 309 | noremap 'a;k 108j 310 | noremap 'a;l 109j 311 | noremap 'aa; 110j 312 | noremap 'aaa 111j 313 | noremap 'aas 112j 314 | noremap 'aad 113j 315 | noremap 'aaf 114j 316 | noremap 'aag 115j 317 | noremap 'aah 116j 318 | noremap 'aaj 117j 319 | noremap 'aak 118j 320 | noremap 'aal 119j 321 | noremap 'as; 120j 322 | noremap 'asa 121j 323 | noremap 'ass 122j 324 | noremap 'asd 123j 325 | noremap 'asf 124j 326 | noremap 'asg 125j 327 | noremap 'ash 126j 328 | noremap 'asj 127j 329 | noremap 'ask 128j 330 | noremap 'asl 129j 331 | noremap 'ad; 130j 332 | noremap 'ada 131j 333 | noremap 'ads 132j 334 | noremap 'add 133j 335 | noremap 'adf 134j 336 | noremap 'adg 135j 337 | noremap 'adh 136j 338 | noremap 'adj 137j 339 | noremap 'adk 138j 340 | noremap 'adl 139j 341 | noremap 'af; 140j 342 | noremap 'afa 141j 343 | noremap 'afs 142j 344 | noremap 'afd 143j 345 | noremap 'aff 144j 346 | noremap 'afg 145j 347 | noremap 'afh 146j 348 | noremap 'afj 147j 349 | noremap 'afk 148j 350 | noremap 'afl 149j 351 | noremap 'ag; 150j 352 | noremap 'aga 151j 353 | noremap 'ags 152j 354 | noremap 'agd 153j 355 | noremap 'agf 154j 356 | noremap 'agg 155j 357 | noremap 'agh 156j 358 | noremap 'agj 157j 359 | noremap 'agk 158j 360 | noremap 'agl 159j 361 | noremap 'ah; 160j 362 | noremap 'aha 161j 363 | noremap 'ahs 162j 364 | noremap 'ahd 163j 365 | noremap 'ahf 164j 366 | noremap 'ahg 165j 367 | noremap 'ahh 166j 368 | noremap 'ahj 167j 369 | noremap 'ahk 168j 370 | noremap 'ahl 169j 371 | noremap 'aj; 170j 372 | noremap 'aja 171j 373 | noremap 'ajs 172j 374 | noremap 'ajd 173j 375 | noremap 'ajf 174j 376 | noremap 'ajg 175j 377 | noremap 'ajh 176j 378 | noremap 'ajj 177j 379 | noremap 'ajk 178j 380 | noremap 'ajl 179j 381 | noremap 'ak; 180j 382 | noremap 'aka 181j 383 | noremap 'aks 182j 384 | noremap 'akd 183j 385 | noremap 'akf 184j 386 | noremap 'akg 185j 387 | noremap 'akh 186j 388 | noremap 'akj 187j 389 | noremap 'akk 188j 390 | noremap 'akl 189j 391 | noremap 'al; 190j 392 | noremap 'ala 191j 393 | noremap 'als 192j 394 | noremap 'ald 193j 395 | noremap 'alf 194j 396 | noremap 'alg 195j 397 | noremap 'alh 196j 398 | noremap 'alj 197j 399 | noremap 'alk 198j 400 | noremap 'all 199j 401 | -------------------------------------------------------------------------------- /default_configs/_machine_specific_default.vim: -------------------------------------------------------------------------------- 1 | " please read through this file and change what you need to change 2 | 3 | let g:snips_author = 'David Chen' 4 | 5 | let g:python_host_prog='/usr/bin/python2' 6 | let g:python3_host_prog='/usr/bin/python3' 7 | 8 | let g:mkdp_browser = 'chromium' 9 | let g:mkdp_browserfunc = 'open ' 10 | 11 | let g:flutter_default_device = 'iPhone\ 11\ Pro' 12 | let g:flutter_run_args = "--flavor dev" 13 | 14 | let g:mkdp_browserfunc = 'open ' 15 | 16 | let g:barbaric_ime = 'fcitx' 17 | -------------------------------------------------------------------------------- /demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theniceboy/nvim/2f83a1c4a5774a6679d0bb037b6bf257615e1b42/demo.png -------------------------------------------------------------------------------- /ftplugin/c.vim: -------------------------------------------------------------------------------- 1 | setlocal shiftwidth=2 softtabstop=2 expandtab smarttab 2 | -------------------------------------------------------------------------------- /ftplugin/cs.vim: -------------------------------------------------------------------------------- 1 | set tabstop=4 2 | set shiftwidth=4 3 | set expandtab 4 | 5 | nnoremap aw :CocAction 6 | -------------------------------------------------------------------------------- /ftplugin/dart.vim: -------------------------------------------------------------------------------- 1 | setlocal shiftwidth=2 softtabstop=2 expandtab smarttab 2 | 3 | noremap :CocList --input=flutter commands 4 | 5 | noremap 'l :CocCommand flutter.dev.openDevLog 6 | noremap 'r :noa w:CocCommand flutter.dev.hotRestart 7 | noremap 'c :CocCommand flutter.dev.clearDevLog 8 | -------------------------------------------------------------------------------- /ftplugin/go.vim: -------------------------------------------------------------------------------- 1 | nnoremap tf :GoTestFunc 2 | -------------------------------------------------------------------------------- /ftplugin/graphml.vim: -------------------------------------------------------------------------------- 1 | setlocal shiftwidth=2 softtabstop=2 expandtab smarttab 2 | -------------------------------------------------------------------------------- /ftplugin/java.vim: -------------------------------------------------------------------------------- 1 | setlocal shiftwidth=2 softtabstop=2 expandtab smarttab 2 | -------------------------------------------------------------------------------- /ftplugin/markdown.vim: -------------------------------------------------------------------------------- 1 | setlocal shiftwidth=2 softtabstop=2 expandtab smarttab 2 | -------------------------------------------------------------------------------- /ftplugin/prisma.vim: -------------------------------------------------------------------------------- 1 | noremap 'r :noa w:silent exec "!npx prisma format":e 2 | -------------------------------------------------------------------------------- /ftplugin/racket.vim: -------------------------------------------------------------------------------- 1 | setlocal shiftwidth=2 softtabstop=2 expandtab smarttab 2 | let g:AutoPairs = {'(':')', '[':']', '{':'}', '"':'"', "`":"`", '```':'```', '"""':'"""', "'''":"'''"} 3 | -------------------------------------------------------------------------------- /ftplugin/swift.vim: -------------------------------------------------------------------------------- 1 | setlocal shiftwidth=4 softtabstop=4 expandtab smarttab 2 | -------------------------------------------------------------------------------- /ftplugin/text.vim: -------------------------------------------------------------------------------- 1 | setlocal shiftwidth=2 softtabstop=2 expandtab smarttab 2 | -------------------------------------------------------------------------------- /init.vim: -------------------------------------------------------------------------------- 1 | " __ ____ __ _ ___ _____ __ __ ____ ____ 2 | "| \/ \ \ / / | \ | \ \ / /_ _| \/ | _ \ / ___| 3 | "| |\/| |\ V / | \| |\ \ / / | || |\/| | |_) | | 4 | "| | | | | | | |\ | \ V / | || | | | _ <| |___ 5 | "|_| |_| |_| |_| \_| \_/ |___|_| |_|_| \_\\____| 6 | 7 | " Author: @theniceboy 8 | 9 | " Checkout-list 10 | " vim-esearch 11 | " fmoralesc/worldslice 12 | " SidOfc/mkdx 13 | 14 | 15 | " ==================== Auto load for first time uses ==================== 16 | if empty(glob($HOME.'/.config/nvim/autoload/plug.vim')) 17 | silent !curl -fLo $HOME/.config/nvim/autoload/plug.vim --create-dirs 18 | \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 19 | autocmd VimEnter * PlugInstall --sync | source $MYVIMRC 20 | endif 21 | 22 | let g:nvim_plugins_installation_completed=1 23 | if empty(glob($HOME.'/.config/nvim/plugged/wildfire.vim/autoload/wildfire.vim')) 24 | let g:nvim_plugins_installation_completed=0 25 | autocmd VimEnter * PlugInstall --sync | source $MYVIMRC 26 | endif 27 | 28 | " Create a _machine_specific.vim file to adjust machine specific stuff, like python interpreter location 29 | let has_machine_specific_file = 1 30 | if empty(glob('~/.config/nvim/_machine_specific.vim')) 31 | let has_machine_specific_file = 0 32 | silent! exec "!cp ~/.config/nvim/default_configs/_machine_specific_default.vim ~/.config/nvim/_machine_specific.vim" 33 | endif 34 | source $HOME/.config/nvim/_machine_specific.vim 35 | 36 | " ==================== Editor behavior ==================== 37 | "set clipboard=unnamedplus 38 | let &t_ut='' 39 | set autochdir 40 | set exrc 41 | set secure 42 | set number 43 | set relativenumber 44 | set cursorline 45 | set noexpandtab 46 | set tabstop=2 47 | set shiftwidth=2 48 | set softtabstop=2 49 | set autoindent 50 | set list 51 | set listchars=tab:\|\ ,trail:▫ 52 | set scrolloff=4 53 | set ttimeoutlen=0 54 | set notimeout 55 | set viewoptions=cursor,folds,slash,unix 56 | set wrap 57 | set tw=0 58 | set indentexpr= 59 | set foldmethod=indent 60 | set foldlevel=99 61 | set foldenable 62 | set formatoptions-=tc 63 | set splitright 64 | set splitbelow 65 | set noshowmode 66 | set ignorecase 67 | set smartcase 68 | set shortmess+=c 69 | set inccommand=split 70 | set completeopt=longest,noinsert,menuone,noselect,preview 71 | set lazyredraw 72 | set visualbell 73 | silent !mkdir -p $HOME/.config/nvim/tmp/backup 74 | silent !mkdir -p $HOME/.config/nvim/tmp/undo 75 | "silent !mkdir -p $HOME/.config/nvim/tmp/sessions 76 | set backupdir=$HOME/.config/nvim/tmp/backup,. 77 | set directory=$HOME/.config/nvim/tmp/backup,. 78 | if has('persistent_undo') 79 | set undofile 80 | set undodir=$HOME/.config/nvim/tmp/undo,. 81 | endif 82 | set colorcolumn=100 83 | set updatetime=100 84 | set virtualedit=block 85 | 86 | au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif 87 | 88 | 89 | " ==================== Terminal Behaviors ==================== 90 | let g:neoterm_autoscroll = 1 91 | autocmd TermOpen term://* startinsert 92 | tnoremap 93 | tnoremap 94 | 95 | 96 | " ==================== Basic Mappings ==================== 97 | let mapleader=" " 98 | noremap ; : 99 | nnoremap Q :q 100 | nnoremap S :w 101 | " Open the vimrc file anytime 102 | nnoremap rc :e $HOME/.config/nvim/init.vim 103 | nnoremap rv :e .nvimrc 104 | augroup NVIMRC 105 | autocmd! 106 | autocmd BufWritePost *.nvimrc exec ":so %" 107 | augroup END 108 | " Undo operations 109 | noremap l u 110 | " Insert Key 111 | noremap k i 112 | noremap K I 113 | " Copy to system clipboard 114 | vnoremap Y "+y 115 | " Find pair 116 | noremap ,. % 117 | vnoremap ki $% 118 | " Search 119 | noremap :nohlsearch 120 | " Adjacent duplicate words 121 | noremap dw /\(\<\w\+\>\)\_s*\1 122 | " Space to Tab 123 | nnoremap tt :%s/ /\t/g 124 | vnoremap tt :s/ /\t/g 125 | " Folding 126 | noremap o za 127 | 128 | " insert a pair of {} and go to the next line 129 | inoremap A {}iko 130 | 131 | " ==================== Cursor Movement ==================== 132 | " New cursor movement (the default arrow keys are used for resizing windows) 133 | " ^ 134 | " u 135 | " < n i > 136 | " e 137 | " v 138 | noremap u k 139 | noremap n h 140 | noremap e j 141 | noremap i l 142 | noremap gu gk 143 | noremap ge gj 144 | noremap \v v$h 145 | " U/E keys for 5 times u/e (faster navigation) 146 | noremap U 5k 147 | noremap E 5j 148 | " N key: go to the start of the line 149 | noremap N 0 150 | " I key: go to the end of the line 151 | noremap I $ 152 | " Faster in-line navigation 153 | noremap W 5w 154 | noremap B 5b 155 | " set h (same as n, cursor left) to 'end of word' 156 | noremap h e 157 | " Ctrl + U or E will move up/down the view port without moving the cursor 158 | noremap 5 159 | noremap 5 160 | " Custom cursor movement 161 | source $HOME/.config/nvim/cursor.vim 162 | " If you use Qwerty keyboard, uncomment the next line. 163 | " source $HOME/nvim/cursor_for_qwerty.vim 164 | 165 | 166 | " ==================== Insert Mode Cursor Movement ==================== 167 | inoremap A 168 | 169 | 170 | " ==================== Command Mode Cursor Movement ==================== 171 | cnoremap 172 | cnoremap 173 | cnoremap 174 | cnoremap 175 | cnoremap 176 | cnoremap 177 | cnoremap 178 | cnoremap 179 | 180 | 181 | " ==================== Window management ==================== 182 | " Use + new arrow keys for moving the cursor around windows 183 | noremap w w 184 | noremap u k 185 | noremap e j 186 | noremap n h 187 | noremap i l 188 | noremap qf o 189 | " Disable the default s key 190 | noremap s 191 | " split the screens to up (horizontal), down (horizontal), left (vertical), right (vertical) 192 | noremap su :set nosplitbelow:split:set splitbelow 193 | noremap se :set splitbelow:split 194 | noremap sn :set nosplitright:vsplit:set splitright 195 | noremap si :set splitright:vsplit 196 | " Resize splits with arrow keys 197 | noremap :res +5 198 | noremap :res -5 199 | noremap :vertical resize-5 200 | noremap :vertical resize+5 201 | " Place the two screens up and down 202 | noremap sh tK 203 | " Place the two screens side by side 204 | noremap sv tH 205 | " Rotate screens 206 | noremap srh bK 207 | noremap srv bH 208 | " Press + q to close the window below the current window 209 | noremap q j:q 210 | 211 | 212 | " ==================== Tab management ==================== 213 | " Create a new tab with tu 214 | noremap tu :tabe 215 | noremap tU :tab split 216 | " Move around tabs with tn and ti 217 | noremap tn :-tabnext 218 | noremap ti :+tabnext 219 | " Move the tabs with tmn and tmi 220 | noremap tmn :-tabmove 221 | noremap tmi :+tabmove 222 | 223 | 224 | " ==================== Markdown Settings ==================== 225 | " Snippets 226 | source $HOME/.config/nvim/md-snippets.vim 227 | " auto spell 228 | autocmd BufRead,BufNewFile *.md setlocal spell 229 | 230 | 231 | " ==================== Other useful stuff ==================== 232 | " Open a new instance of st with the cwd 233 | nnoremap \t :tabe:-tabmove:term sh -c 'st':q 234 | " Press space twice to jump to the next '<++>' and edit it 235 | noremap /<++>:nohlsearch"_c4l 236 | " Spelling Check with sc 237 | noremap sc :set spell! 238 | " Press ` to change case (instead of ~) 239 | noremap ` ~ 240 | noremap zz 241 | " Auto change directory to current dir 242 | autocmd BufEnter * silent! lcd %:p:h 243 | " Call figlet 244 | noremap tx :r !figlet 245 | " find and replace 246 | noremap \s :%s//g 247 | " set wrap 248 | noremap sw :set wrap 249 | " press f10 to show hlgroup 250 | " function! SynGroup() 251 | " let l:s = synID(line('.'), col('.'), 1) 252 | " echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name') 253 | " endfun 254 | map :TSHighlightCapturesUnderCursor 255 | 256 | " Compile function 257 | noremap r :call CompileRunGcc() 258 | func! CompileRunGcc() 259 | exec "w" 260 | if &filetype == 'c' 261 | set splitbelow 262 | :sp 263 | :res -5 264 | term gcc % -o %< && time ./%< 265 | elseif &filetype == 'cpp' 266 | set splitbelow 267 | exec "!g++ -std=c++11 % -Wall -o %<" 268 | :sp 269 | :res -15 270 | :term ./%< 271 | elseif &filetype == 'cs' 272 | set splitbelow 273 | silent! exec "!mcs %" 274 | :sp 275 | :res -5 276 | :term mono %<.exe 277 | elseif &filetype == 'java' 278 | set splitbelow 279 | :sp 280 | :res -5 281 | term javac % && time java %< 282 | elseif &filetype == 'sh' 283 | :!time bash % 284 | elseif &filetype == 'python' 285 | set splitbelow 286 | :sp 287 | :term python3 % 288 | elseif &filetype == 'html' 289 | silent! exec "!".g:mkdp_browser." % &" 290 | elseif &filetype == 'markdown' 291 | exec "InstantMarkdownPreview" 292 | elseif &filetype == 'tex' 293 | silent! exec "VimtexStop" 294 | silent! exec "VimtexCompile" 295 | elseif &filetype == 'dart' 296 | exec "CocCommand flutter.run -d ".g:flutter_default_device." ".g:flutter_run_args 297 | silent! exec "CocCommand flutter.dev.openDevLog" 298 | elseif &filetype == 'javascript' 299 | set splitbelow 300 | :sp 301 | :term export DEBUG="INFO,ERROR,WARNING"; node --trace-warnings . 302 | elseif &filetype == 'racket' 303 | set splitbelow 304 | :sp 305 | :res -5 306 | term racket % 307 | elseif &filetype == 'go' 308 | set splitbelow 309 | :sp 310 | :term go run . 311 | endif 312 | endfunc 313 | 314 | 315 | " ==================== Install Plugins with Vim-Plug ==================== 316 | call plug#begin('$HOME/.config/nvim/plugged') 317 | 318 | Plug 'itchyny/vim-cursorword' 319 | 320 | " Github Copilot 321 | Plug 'github/copilot.vim' 322 | 323 | " Treesitter 324 | Plug 'nvim-treesitter/nvim-treesitter' 325 | Plug 'nvim-treesitter/playground' 326 | 327 | " Pretty Dress 328 | Plug 'theniceboy/nvim-deus' 329 | "Plug 'arzg/vim-colors-xcode' 330 | 331 | " Status line 332 | Plug 'theniceboy/eleline.vim', { 'branch': 'no-scrollbar' } 333 | 334 | " General Highlighter 335 | Plug 'NvChad/nvim-colorizer.lua' 336 | Plug 'RRethy/vim-illuminate' 337 | 338 | " File navigation 339 | Plug 'ibhagwan/fzf-lua' 340 | Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } 341 | Plug 'junegunn/fzf.vim' 342 | Plug 'theniceboy/joshuto.nvim' 343 | Plug 'kevinhwang91/rnvimr' 344 | Plug 'airblade/vim-rooter' 345 | Plug 'pechorin/any-jump.vim' 346 | 347 | " Debugger 348 | " Plug 'puremourning/vimspector', {'do': './install_gadget.py --enable-c --enable-python --enable-go'} 349 | 350 | " Auto Complete 351 | Plug 'neoclide/coc.nvim', { 'commit': '63dd239bfe02998810b39d039827e2510885b57b', 'do': 'yarn install --frozen-lockfile' } 352 | " Plug 'neoclide/coc.nvim', {'branch': 'release', 'tag': 'v0.0.79'} 353 | Plug 'wellle/tmux-complete.vim' 354 | 355 | " Snippets 356 | " Plug 'SirVer/ultisnips' 357 | Plug 'theniceboy/vim-snippets' 358 | 359 | " Undo Tree 360 | Plug 'mbbill/undotree' 361 | 362 | " Git 363 | Plug 'theniceboy/vim-gitignore', { 'for': ['gitignore', 'vim-plug'] } 364 | Plug 'theniceboy/fzf-gitignore', { 'do': ':UpdateRemotePlugins' } 365 | "Plug 'mhinz/vim-signify' 366 | Plug 'lewis6991/gitsigns.nvim' 367 | Plug 'cohama/agit.vim' 368 | Plug 'kdheepak/lazygit.nvim' 369 | 370 | " Tex 371 | " Plug 'lervag/vimtex' 372 | 373 | " CSharp 374 | Plug 'OmniSharp/omnisharp-vim' 375 | Plug 'ctrlpvim/ctrlp.vim' , { 'for': ['cs', 'vim-plug'] } " omnisharp-vim dependency 376 | 377 | " HTML, CSS, JavaScript, Typescript, PHP, JSON, etc. 378 | Plug 'elzr/vim-json' 379 | Plug 'neoclide/jsonc.vim' 380 | Plug 'othree/html5.vim' 381 | Plug 'alvan/vim-closetag' 382 | " Plug 'hail2u/vim-css3-syntax' " , { 'for': ['vim-plug', 'php', 'html', 'javascript', 'css', 'less'] } 383 | " Plug 'spf13/PIV', { 'for' :['php', 'vim-plug'] } 384 | " Plug 'pangloss/vim-javascript', { 'for': ['vim-plug', 'php', 'html', 'javascript', 'css', 'less'] } 385 | Plug 'yuezk/vim-js', { 'for': ['vim-plug', 'php', 'html', 'javascript', 'css', 'less'] } 386 | " Plug 'MaxMEllon/vim-jsx-pretty', { 'for': ['vim-plug', 'php', 'html', 'javascript', 'css', 'less'] } 387 | " Plug 'jelera/vim-javascript-syntax', { 'for': ['vim-plug', 'php', 'html', 'javascript', 'css', 'less'] } 388 | "Plug 'jaxbot/browserlink.vim' 389 | Plug 'HerringtonDarkholme/yats.vim' 390 | " Plug 'posva/vim-vue' 391 | " Plug 'evanleck/vim-svelte', {'branch': 'main'} 392 | " Plug 'leafOfTree/vim-svelte-plugin' 393 | " Plug 'leafgarland/typescript-vim' 394 | Plug 'MaxMEllon/vim-jsx-pretty' 395 | Plug 'pangloss/vim-javascript' 396 | Plug 'leafgarland/typescript-vim' 397 | Plug 'peitalin/vim-jsx-typescript' 398 | Plug 'styled-components/vim-styled-components', { 'branch': 'main' } 399 | Plug 'pantharshit00/vim-prisma' 400 | 401 | " Go 402 | Plug 'fatih/vim-go' , { 'for': ['go', 'vim-plug'], 'tag': '*' } 403 | 404 | " Python 405 | Plug 'Vimjas/vim-python-pep8-indent', { 'for' :['python', 'vim-plug'] } 406 | Plug 'numirias/semshi', { 'do': ':UpdateRemotePlugins', 'for' :['python', 'vim-plug'] } 407 | Plug 'tweekmonster/braceless.vim', { 'for' :['python', 'vim-plug'] } 408 | "Plug 'vim-scripts/indentpython.vim', { 'for' :['python', 'vim-plug'] } 409 | "Plug 'plytophogy/vim-virtualenv', { 'for' :['python', 'vim-plug'] } 410 | "Plug 'tmhedberg/SimpylFold', { 'for' :['python', 'vim-plug'] } 411 | 412 | " Dart 413 | Plug 'dart-lang/dart-vim-plugin', { 'for': ['dart', 'vim-plug'] } 414 | 415 | " Swift 416 | Plug 'keith/swift.vim' 417 | Plug 'arzg/vim-swift' 418 | 419 | " Markdown 420 | Plug 'suan/vim-instant-markdown', {'for': 'markdown'} 421 | Plug 'dhruvasagar/vim-table-mode', { 'on': 'TableModeToggle', 'for': ['text', 'markdown', 'vim-plug'] } 422 | Plug 'mzlogin/vim-markdown-toc', { 'for': ['gitignore', 'markdown', 'vim-plug'] } 423 | Plug 'dkarter/bullets.vim' 424 | 425 | " Other filetypes 426 | Plug 'wlangstroth/vim-racket' 427 | " Plug 'jceb/vim-orgmode', {'for': ['vim-plug', 'org']} 428 | Plug 'hashivim/vim-terraform' 429 | 430 | " Editor Enhancement 431 | Plug 'petertriho/nvim-scrollbar' 432 | Plug 'kevinhwang91/nvim-hlslens' 433 | Plug 'ggandor/lightspeed.nvim' 434 | "Plug 'Raimondi/delimitMate' 435 | Plug 'jiangmiao/auto-pairs' 436 | Plug 'mg979/vim-visual-multi' 437 | Plug 'theniceboy/tcomment_vim' " in cn to comment a line 438 | Plug 'theniceboy/antovim' " gs to switch 439 | Plug 'tpope/vim-surround' " type yskw' to wrap the word with '' or type cs'` to change 'word' to `word` 440 | Plug 'gcmt/wildfire.vim' " in Visual mode, type k' to select all text in '', or type k) k] k} kp 441 | Plug 'junegunn/vim-after-object' " da= to delete what's after = 442 | Plug 'godlygeek/tabular' " ga, or :Tabularize to align 443 | Plug 'tpope/vim-capslock' " Ctrl+L (insert) to toggle capslock 444 | " Plug 'Konfekt/FastFold' 445 | "Plug 'junegunn/vim-peekaboo' 446 | "Plug 'wellle/context.vim' 447 | Plug 'svermeulen/vim-subversive' 448 | Plug 'theniceboy/argtextobj.vim' 449 | Plug 'rhysd/clever-f.vim' 450 | Plug 'AndrewRadev/splitjoin.vim' 451 | Plug 'theniceboy/pair-maker.vim' 452 | Plug 'theniceboy/vim-move' 453 | " Plug 'jeffkreeftmeijer/vim-numbertoggle' 454 | Plug 'Yggdroot/indentLine' 455 | 456 | " For general writing 457 | Plug 'junegunn/goyo.vim' 458 | Plug 'reedes/vim-wordy' 459 | "Plug 'ron89/thesaurus_query.vim' 460 | 461 | " Bookmarks 462 | " Plug 'MattesGroeger/vim-bookmarks' 463 | 464 | " Find & Replace 465 | Plug 'nvim-lua/plenary.nvim' " nvim-spectre dep 466 | Plug 'nvim-pack/nvim-spectre' 467 | 468 | " Documentation 469 | " Plug 'KabbAmine/zeavim.vim' " z to find doc 470 | 471 | " Mini Vim-APP 472 | "Plug 'jceb/vim-orgmode' 473 | "Plug 'mhinz/vim-startify' 474 | Plug 'skywind3000/asynctasks.vim' 475 | Plug 'skywind3000/asyncrun.vim' 476 | 477 | " Vim Applications 478 | Plug 'itchyny/calendar.vim' 479 | 480 | " Other visual enhancement 481 | Plug 'luochen1990/rainbow' 482 | Plug 'mg979/vim-xtabline' 483 | Plug 'ryanoasis/vim-devicons' 484 | Plug 'wincent/terminus' 485 | Plug 'kyazdani42/nvim-web-devicons' 486 | 487 | " Other useful utilities 488 | Plug 'lambdalisue/suda.vim' " do stuff like :sudowrite 489 | " Plug 'makerj/vim-pdf' 490 | 491 | call plug#end() 492 | 493 | set re=0 494 | 495 | 496 | " ==================== Dress up my vim ==================== 497 | set termguicolors " enable true colors support 498 | let $NVIM_TUI_ENABLE_TRUE_COLOR=1 499 | silent! color deus 500 | 501 | hi NonText ctermfg=gray guifg=grey10 502 | "hi SpecialKey ctermfg=blue guifg=grey70 503 | 504 | 505 | " ==================== eleline.vim ==================== 506 | let g:airline_powerline_fonts = 0 507 | 508 | 509 | " ==================== gitsigns.nvim ==================== 510 | lua < 523 | nnoremap gr :Gitsigns reset_hunk 524 | nnoremap gb :Gitsigns blame_line 525 | nnoremap g- :Gitsigns prev_hunk 526 | nnoremap g= :Gitsigns next_hunk 527 | 528 | 529 | " ==================== coc.nvim ==================== 530 | let g:coc_global_extensions = [ 531 | \ 'coc-css', 532 | \ 'coc-diagnostic', 533 | \ 'coc-docker', 534 | \ 'coc-eslint', 535 | \ 'coc-explorer', 536 | \ 'coc-flutter-tools', 537 | \ 'coc-gitignore', 538 | \ 'coc-html', 539 | \ 'coc-import-cost', 540 | \ 'coc-java', 541 | \ 'coc-jest', 542 | \ 'coc-json', 543 | \ 'coc-lists', 544 | \ 'coc-omnisharp', 545 | \ 'coc-prettier', 546 | \ 'coc-prisma', 547 | \ 'coc-pyright', 548 | \ 'coc-snippets', 549 | \ 'coc-sourcekit', 550 | \ 'coc-stylelint', 551 | \ 'coc-syntax', 552 | \ 'https://github.com/theniceboy/coc-tailwindcss', 553 | \ 'coc-tasks', 554 | \ 'coc-translator', 555 | \ 'coc-tsserver', 556 | \ 'coc-vetur', 557 | \ 'coc-vimlsp', 558 | \ 'coc-yaml', 559 | \ 'coc-yank'] 560 | inoremap 561 | \ coc#pum#visible() ? coc#pum#next(1) : 562 | \ CheckBackspace() ? "\" : 563 | \ coc#refresh() 564 | inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" 565 | 566 | " Make to accept selected completion item or notify coc.nvim to format 567 | " u breaks current undo, please make your own choice. 568 | inoremap coc#pum#visible() ? coc#pum#confirm() 569 | \: "\u\\=coc#on_enter()\" 570 | 571 | function! CheckBackspace() abort 572 | let col = col('.') - 1 573 | return !col || getline('.')[col - 1] =~# '\s' 574 | endfunction 575 | inoremap coc#refresh() 576 | inoremap coc#refresh() 577 | function! Show_documentation() 578 | call CocActionAsync('highlight') 579 | if (index(['vim','help'], &filetype) >= 0) 580 | execute 'h '.expand('') 581 | else 582 | call CocAction('doHover') 583 | endif 584 | endfunction 585 | nnoremap h :call Show_documentation() 586 | " set runtimepath^=~/.config/nvim/coc-extensions/coc-flutter-tools/ 587 | " let g:coc_node_args = ['--nolazy', '--inspect-brk=6045'] 588 | " let $NVIM_COC_LOG_LEVEL = 'debug' 589 | " let $NVIM_COC_LOG_FILE = '/Users/david/Desktop/log.txt' 590 | 591 | nnoremap d :CocList diagnostics 592 | nmap - (coc-diagnostic-prev) 593 | nmap = (coc-diagnostic-next) 594 | nnoremap :CocCommand 595 | " Text Objects 596 | xmap kf (coc-funcobj-i) 597 | xmap af (coc-funcobj-a) 598 | omap kf (coc-funcobj-i) 599 | omap af (coc-funcobj-a) 600 | xmap kc (coc-classobj-i) 601 | omap kc (coc-classobj-i) 602 | xmap ac (coc-classobj-a) 603 | omap ac (coc-classobj-a) 604 | " Useful commands 605 | nnoremap y :CocList -A --normal yank 606 | nmap gd (coc-definition) 607 | nmap gD :tab sp(coc-definition) 608 | nmap gy (coc-type-definition) 609 | " nmap gi (coc-implementation) 610 | nmap gr (coc-references) 611 | nmap rn (coc-rename) 612 | nmap tt :CocCommand explorer 613 | " coc-translator 614 | nmap ts (coc-translator-p) 615 | " Remap for do codeAction of selected region 616 | function! s:cocActionsOpenFromSelected(type) abort 617 | execute 'CocCommand actions.open ' . a:type 618 | endfunction 619 | xmap a (coc-codeaction-selected) 620 | nmap aw (coc-codeaction-selected)w 621 | " coctodolist 622 | " nnoremap tn :CocCommand todolist.create 623 | " nnoremap tl :CocList todolist 624 | " nnoremap tu :CocCommand todolist.download:CocCommand todolist.upload 625 | " coc-tasks 626 | noremap ts :CocList tasks 627 | " coc-snippets 628 | imap (coc-snippets-expand) 629 | vmap (coc-snippets-select) 630 | let g:coc_snippet_next = '' 631 | let g:coc_snippet_prev = '' 632 | imap (coc-snippets-expand-jump) 633 | autocmd BufRead,BufNewFile tsconfig.json set filetype=jsonc 634 | 635 | 636 | " ==================== vim-instant-markdown ==================== 637 | let g:instant_markdown_slow = 0 638 | let g:instant_markdown_autostart = 0 639 | " let g:instant_markdown_open_to_the_world = 1 640 | " let g:instant_markdown_allow_unsafe_content = 1 641 | " let g:instant_markdown_allow_external_content = 0 642 | " let g:instant_markdown_mathjax = 1 643 | let g:instant_markdown_autoscroll = 1 644 | 645 | 646 | " ==================== vim-table-mode ==================== 647 | noremap tm :TableModeToggle 648 | "let g:table_mode_disable_mappings = 1 649 | let g:table_mode_cell_text_object_i_map = 'k' 650 | 651 | 652 | " ==================== FZF ==================== 653 | let g:fzf_preview_window = 'right:40%' 654 | let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"' 655 | 656 | function! s:list_buffers() 657 | redir => list 658 | silent ls 659 | redir END 660 | return split(list, "\n") 661 | endfunction 662 | 663 | function! s:delete_buffers(lines) 664 | execute 'bwipeout' join(map(a:lines, {_, line -> split(line)[0]})) 665 | endfunction 666 | 667 | command! BD call fzf#run(fzf#wrap({ 668 | \ 'source': s:list_buffers(), 669 | \ 'sink*': { lines -> s:delete_buffers(lines) }, 670 | \ 'options': '--multi --reverse --bind ctrl-a:select-all+accept' 671 | \ })) 672 | 673 | noremap :BD 674 | 675 | let g:fzf_layout = { 'window': { 'width': 0.95, 'height': 0.95 } } 676 | 677 | 678 | " ==================== CTRLP (Dependency for omnisharp) ==================== 679 | let g:ctrlp_map = '' 680 | let g:ctrlp_cmd = 'CtrlP' 681 | 682 | " ==================== wildfire ==================== 683 | map (wildfire-quick-select) 684 | let g:wildfire_objects = { 685 | \ "*" : ["i'", 'i"', "i)", "i]", "i}", "it"], 686 | \ "html,xml" : ["at", "it"], 687 | \ } 688 | 689 | 690 | " ==================== Undotree ==================== 691 | noremap L :UndotreeToggle 692 | let g:undotree_DiffAutoOpen = 1 693 | let g:undotree_SetFocusWhenToggle = 1 694 | let g:undotree_ShortIndicators = 1 695 | let g:undotree_WindowLayout = 2 696 | let g:undotree_DiffpanelHeight = 8 697 | let g:undotree_SplitWidth = 24 698 | function g:Undotree_CustomMap() 699 | nmap u UndotreeNextState 700 | nmap e UndotreePreviousState 701 | nmap U 5UndotreeNextState 702 | nmap E 5UndotreePreviousState 703 | endfunc 704 | 705 | 706 | " ==================== vim-visual-multi ==================== 707 | "let g:VM_theme = 'iceblue' 708 | "let g:VM_default_mappings = 0 709 | let g:VM_leader = {'default': ',', 'visual': ',', 'buffer': ','} 710 | let g:VM_maps = {} 711 | let g:VM_custom_motions = {'n': 'h', 'i': 'l', 'u': 'k', 'e': 'j', 'N': '0', 'I': '$', 'h': 'e'} 712 | let g:VM_maps['i'] = 'k' 713 | let g:VM_maps['I'] = 'K' 714 | let g:VM_maps['Find Under'] = '' 715 | let g:VM_maps['Find Subword Under'] = '' 716 | let g:VM_maps['Find Next'] = '' 717 | let g:VM_maps['Find Prev'] = '' 718 | let g:VM_maps['Remove Region'] = 'q' 719 | let g:VM_maps['Skip Region'] = '' 720 | let g:VM_maps["Undo"] = 'l' 721 | let g:VM_maps["Redo"] = '' 722 | 723 | 724 | " ==================== nvim-spectre ==================== 725 | nnoremap f lua require('spectre').open() 726 | vnoremap f lua require('spectre').open_visual() 727 | 728 | 729 | " ==================== Bullets.vim ==================== 730 | " let g:bullets_set_mappings = 0 731 | let g:bullets_enabled_file_types = [ 732 | \ 'markdown', 733 | \ 'text', 734 | \ 'gitcommit', 735 | \ 'scratch' 736 | \] 737 | 738 | 739 | " ==================== fzf-gitignore ==================== 740 | noremap gi :FzfGitignore 741 | 742 | 743 | " ==================== Ultisnips ==================== 744 | " let g:tex_flavor = "latex" 745 | " inoremap 746 | " let g:UltiSnipsExpandTrigger="" 747 | " let g:UltiSnipsJumpForwardTrigger="" 748 | " let g:UltiSnipsJumpBackwardTrigger="" 749 | " let g:UltiSnipsSnippetDirectories = [$HOME.'/.config/nvim/Ultisnips/', $HOME.'/.config/nvim/plugged/vim-snippets/UltiSnips/'] 750 | " silent! au BufEnter,BufRead,BufNewFile * silent! unmap 751 | " " Solve extreme insert-mode lag on macOS (by disabling autotrigger) 752 | " augroup ultisnips_no_auto_expansion 753 | " au! 754 | " au VimEnter * au! UltiSnips_AutoTrigger 755 | " augroup END 756 | 757 | 758 | " ==================== vim-calendar ==================== 759 | "noremap \c :Calendar -position=here 760 | noremap \\ :Calendar -view=clock -position=here 761 | let g:calendar_google_calendar = 1 762 | let g:calendar_google_task = 1 763 | augroup calendar-mappings 764 | autocmd! 765 | " diamond cursor 766 | autocmd FileType calendar nmap u (calendar_up) 767 | autocmd FileType calendar nmap n (calendar_left) 768 | autocmd FileType calendar nmap e (calendar_down) 769 | autocmd FileType calendar nmap i (calendar_right) 770 | autocmd FileType calendar nmap (calendar_move_up) 771 | autocmd FileType calendar nmap (calendar_move_left) 772 | autocmd FileType calendar nmap (calendar_move_down) 773 | autocmd FileType calendar nmap (calendar_move_right) 774 | autocmd FileType calendar nmap k (calendar_start_insert) 775 | autocmd FileType calendar nmap K (calendar_start_insert_head) 776 | " unmap , for other plugins 777 | autocmd FileType calendar nunmap 778 | autocmd FileType calendar nunmap 779 | augroup END 780 | 781 | 782 | " ==================== vim-go ==================== 783 | let g:go_echo_go_info = 0 784 | let g:go_doc_popup_window = 1 785 | let g:go_def_mapping_enabled = 0 786 | let g:go_template_autocreate = 0 787 | let g:go_textobj_enabled = 0 788 | let g:go_auto_type_info = 1 789 | let g:go_def_mapping_enabled = 0 790 | let g:go_highlight_array_whitespace_error = 1 791 | let g:go_highlight_build_constraints = 1 792 | let g:go_highlight_chan_whitespace_error = 1 793 | let g:go_highlight_extra_types = 1 794 | let g:go_highlight_fields = 1 795 | let g:go_highlight_format_strings = 1 796 | let g:go_highlight_function_calls = 1 797 | let g:go_highlight_function_parameters = 1 798 | let g:go_highlight_functions = 1 799 | let g:go_highlight_generate_tags = 1 800 | let g:go_highlight_methods = 1 801 | let g:go_highlight_operators = 1 802 | let g:go_highlight_space_tab_error = 1 803 | let g:go_highlight_string_spellcheck = 1 804 | let g:go_highlight_structs = 1 805 | let g:go_highlight_trailing_whitespace_error = 1 806 | let g:go_highlight_types = 1 807 | let g:go_highlight_variable_assignments = 0 808 | let g:go_highlight_variable_declarations = 0 809 | let g:go_doc_keywordprg_enabled = 0 810 | 811 | 812 | " ==================== OmniSharp ==================== 813 | let g:OmniSharp_typeLookupInPreview = 1 814 | let g:omnicomplete_fetch_full_documentation = 1 815 | let g:OmniSharp_server_use_mono = 1 816 | let g:OmniSharp_server_stdio = 1 817 | let g:OmniSharp_highlight_types = 2 818 | let g:OmniSharp_selector_ui = 'ctrlp' 819 | autocmd Filetype cs nnoremap gd :OmniSharpPreviewDefinition 820 | autocmd Filetype cs nnoremap gr :OmniSharpFindUsages 821 | autocmd Filetype cs nnoremap gy :OmniSharpTypeLookup 822 | autocmd Filetype cs nnoremap ga :OmniSharpGetCodeActions 823 | autocmd Filetype cs nnoremap rn :OmniSharpRename:res +5 824 | sign define OmniSharpCodeActions text=💡 825 | let g:coc_sources_disable_map = { 'cs': ['cs', 'cs-1', 'cs-2', 'cs-3'] } 826 | 827 | 828 | " ==================== goyo ==================== 829 | map gy :Goyo 830 | 831 | 832 | " ==================== jsx ==================== 833 | let g:vim_jsx_pretty_colorful_config = 1 834 | 835 | 836 | " ==================== tabular ==================== 837 | vmap ga :Tabularize / 838 | 839 | 840 | " ==================== vim-after-object ==================== 841 | autocmd VimEnter * call after_object#enable('=', ':', '-', '#', ' ') 842 | 843 | 844 | " ==================== rainbow ==================== 845 | let g:rainbow_active = 1 846 | 847 | 848 | " ==================== xtabline ==================== 849 | let g:xtabline_settings = {} 850 | let g:xtabline_settings.enable_mappings = 0 851 | let g:xtabline_settings.tabline_modes = ['tabs', 'buffers'] 852 | let g:xtabline_settings.enable_persistance = 0 853 | let g:xtabline_settings.last_open_first = 1 854 | noremap to :XTabCycleMode 855 | noremap \p :echo expand('%:p') 856 | 857 | 858 | " ==================== context.vim ==================== 859 | "let g:context_add_mappings = 0 860 | "noremap ct :ContextToggle 861 | 862 | 863 | " ==================== suda.vim ==================== 864 | cnoreabbrev sudowrite w suda://% 865 | cnoreabbrev sw w suda://% 866 | 867 | 868 | " ==================== vimspector ==================== 869 | let g:vimspector_enable_mappings = 'HUMAN' 870 | function! s:read_template_into_buffer(template) 871 | " has to be a function to avoid the extra space fzf#run insers otherwise 872 | execute '0r ~/.config/nvim/sample_vimspector_json/'.a:template 873 | endfunction 874 | command! -bang -nargs=* LoadVimSpectorJsonTemplate call fzf#run({ 875 | \ 'source': 'ls -1 ~/.config/nvim/sample_vimspector_json', 876 | \ 'down': 20, 877 | \ 'sink': function('read_template_into_buffer') 878 | \ }) 879 | " noremap vs :tabe .vimspector.json:LoadVimSpectorJsonTemplate 880 | sign define vimspectorBP text=☛ texthl=Normal 881 | sign define vimspectorBPDisabled text=☞ texthl=Normal 882 | sign define vimspectorPC text=🔶 texthl=SpellBad 883 | 884 | 885 | " ==================== vim-markdown-toc ==================== 886 | "let g:vmt_auto_update_on_save = 0 887 | "let g:vmt_dont_insert_fence = 1 888 | let g:vmt_cycle_list_item_markers = 1 889 | let g:vmt_fence_text = 'TOC' 890 | let g:vmt_fence_closing_text = '/TOC' 891 | 892 | 893 | " ==================== rnvimr ==================== 894 | let g:rnvimr_ex_enable = 1 895 | let g:rnvimr_pick_enable = 1 896 | let g:rnvimr_draw_border = 0 897 | " let g:rnvimr_bw_enable = 1 898 | highlight link RnvimrNormal CursorLine 899 | nnoremap R :RnvimrToggle:RnvimrResize 0 900 | let g:rnvimr_action = { 901 | \ '': 'NvimEdit tabedit', 902 | \ '': 'NvimEdit split', 903 | \ '': 'NvimEdit vsplit', 904 | \ 'gw': 'JumpNvimCwd', 905 | \ 'yw': 'EmitRangerCwd' 906 | \ } 907 | let g:rnvimr_layout = { 'relative': 'editor', 908 | \ 'width': &columns, 909 | \ 'height': &lines, 910 | \ 'col': 0, 911 | \ 'row': 0, 912 | \ 'style': 'minimal' } 913 | let g:rnvimr_presets = [{'width': 1.0, 'height': 1.0}] 914 | 915 | 916 | " ==================== vim-subversive ==================== 917 | nmap s (SubversiveSubstitute) 918 | nmap ss (SubversiveSubstituteLine) 919 | 920 | 921 | " ==================== vim-illuminate ==================== 922 | let g:Illuminate_delay = 750 923 | hi illuminatedWord cterm=undercurl gui=undercurl 924 | 925 | 926 | " ==================== vim-rooter ==================== 927 | let g:rooter_patterns = ['__vim_project_root', '.git/'] 928 | let g:rooter_silent_chdir = 1 929 | 930 | 931 | " ==================== AsyncRun ==================== 932 | noremap gp :AsyncRun git push 933 | 934 | 935 | " ==================== AsyncTasks ==================== 936 | let g:asyncrun_open = 6 937 | 938 | 939 | " ==================== tcomment_vim ==================== 940 | nnoremap ci cl 941 | let g:tcomment_textobject_inlinecomment = '' 942 | nmap cn g>c 943 | vmap cn g> 944 | nmap cu gcu g< 946 | 947 | 948 | " ==================== vim-move ==================== 949 | let g:move_key_modifier = 'C' 950 | 951 | 952 | " ==================== any-jump ==================== 953 | nnoremap j :AnyJump 954 | let g:any_jump_window_width_ratio = 0.8 955 | let g:any_jump_window_height_ratio = 0.9 956 | 957 | 958 | " ==================== typescript-vim ==================== 959 | let g:typescript_ignore_browserwords = 1 960 | 961 | 962 | " ==================== Agit ==================== 963 | nnoremap gl :Agit 964 | let g:agit_no_default_mappings = 1 965 | 966 | 967 | " ==================== nvim-treesitter ==================== 968 | if g:nvim_plugins_installation_completed == 1 969 | lua < = execute('normal! ' . v:count1 . 'n') 1012 | \lua require('hlslens').start() 1013 | noremap - execute('normal! ' . v:count1 . 'N') 1014 | \lua require('hlslens').start() 1015 | noremap * *lua require('hlslens').start() 1016 | noremap # #lua require('hlslens').start() 1017 | noremap g* g*lua require('hlslens').start() 1018 | noremap g# g#lua require('hlslens').start() 1019 | 1020 | 1021 | " ==================== fzf-lua ==================== 1022 | noremap :FzfLua files 1023 | noremap :Rg 1024 | noremap :FzfLua oldfiles cwd=~ 1025 | noremap :FzfLua builtin 1026 | noremap :FzfLua lines 1027 | " noremap :FzfLua resume 1028 | noremap z= :FzfLua spell_suggest 1029 | noremap :FzfLua buffers 1030 | noremap ; :History: 1031 | augroup fzf_commands 1032 | autocmd! 1033 | autocmd FileType fzf tnoremap 1034 | autocmd FileType fzf tnoremap 1035 | augroup end 1036 | if g:nvim_plugins_installation_completed == 1 1037 | lua <