# neovim **Repository Path**: ct_java/neovim ## Basic Information - **Project Name**: neovim - **Description**: 改了theniceboy的nvim的一些键位 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2020-03-17 - **Last Updated**: 2021-04-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 我的NeoVim配置 (A NeoVim Config for Colemak Users) ![demo](./demo.png) Please **DO NOT** just copy this config without really looking at it! Please, at least, read this README file! ## 安装后需要: - [ ] Install `pynvim` (pip) - [ ] Install `nodejs` - [ ] Install nerd-font (actually it's optional but it looks real good) ## 安装后,你可能希望 : #### 首先 - [ ] Do `:checkhealth` #### 配置 `Python` path - [ ] Well, make sure you have python - [ ] See `_machine_specific.vim` #### 对于 Code AutoComplete (coc) Python: - [ ] Do `pip3 install flake8` (for linting) #### 对于 Taglist: - [ ] Install `ctags` for function/class/variable list #### 对于 inputing text ASCII art - [ ] Install `figlet` ## Keyboard Shortcuts for `NORMAL` (`COMMAND`) Mode ### 1 基本命令 #### 1.1 最基本的 **`Q`** : quit current vim window, equals to command `:q` **`S`** : save the current file, equals to command `:w` **_IMPORTANT_** 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`). #### 1.2 Remapped Cursor Movement | Command | What it does | Equivalent (QWERTY) | |------------|-----------------------------------------------------------|---------------------| | `k` | Cursor up a terminal line | `k` | | `j` | Cursor down a terminal line | `j` | | `h` | Cursor left | `h` | | `l` | Cursor right | `l` | | `K` | Cursor up 5 terminal lines | `5k` | | `J` | Cursor down 5 terminal lines | `5j` | | `H` | Cursor to the start of the line | `0` | | `L` | Cursor to the end of the line | `$` | | `Ctrl` `k` | Move the view port up 5 lines without moving the cursor | `Ctrl` `y` | | `Ctrl` `j` | Move the view port down 5 lines without moving the cursor | `Ctrl` `e` | | `h` | Move to the end of this word | `e` | #### 1.3 Remapped Editor Commands | Command | What it does | |---------|--------------| | `l` | undo | #### 1.4 Some Other Commands to Know | Command | What it does | |---------|---------------------------------------| | `` | Go to the next cursor position | | `` | Go to the previous cursor position | | `` | Increase the number under cursor by 1 | | `` | Decrease the number under cursor by 1 | | `z=` | Show spell suggestions | | `H` | Joins the current line with the next | | `<` | Un-indent | | `>` | Indent | ### 2 Window Management #### 2.1 Creating Window Through Split Screen | Command | What it does | |---------|-----------------------------------------------------------------------------| | `sk` | Create a new horizontal split screen and place it above the current window | | `sj` | Create a new horizontal split screen and place it below the current window | | `sh` | Create a new vertical split screen and place it left to the current window | | `sl` | Create a new vertical split screen and place it right to the current window | | `sv` | Set the two splits to be vertical | | `sh` | Set the two splits to be horizontal | | `srv` | Rotate splits and arrange splits vertically | | `srh` | Rotate splits and arrange splits horizontally #### 2.2 Moving the Cursor Between Different Windows | Shortcut | Action | |------------|--------------------------------| | `w` | Move cursor to the next window | | `h` | Move cursor one window left | | `l` | Move cursor one window right | | `k` | Move cursor one window up | | `j` | Move cursor one window down | #### 2.3 Resizing Different Windows Use the arrow keys to resize the current window. ## Plugins #### COC (AutoCompletion) | Shortcut | Action | |-------------|-----------------------| | `Space` `y` | Get yank history list | | `gd` | Go to definition | | `gr` | List references | | `gl` | List implementation | | `gy` | Go to type definition | #### NERDTree | Shortcut | Action | |-------------------|-----------------| | `tt` | Toggle NerdTree | | `,` (in NERDTREE) | Toggle menu | #### Tagbar Press `T` (`Shift` + `t`) to open Taglist (function and variable list). Press `q` to leave Tagbar #### FZF (the fuzzy file finder) | Shortcut | Action | Command | |------------|------------------|---------------| | `Ctrl` `p` | Active FZF | `:FZF` | | `Ctrl` `k` | Move up 1 item | ` ` | | `Ctrl` `j` | Move down 1 item | ` ` | #### Undotree | Shortcut | Action | |---------------|---------------| | `Shift` + `L` | Open Undotree | | `Shift` + `K` | History go up | | `Shift` + `J` | History go down | #### vim-startify (Startup screen) Press `Space` `s` `t` to openup `startify` #### thesaurus_query.vim Press `Space` `t` `h` to find synonyms #### vim-signiture (Bookmarks) | Shortcut | Action | Command | |-------------|---------------------------------|---------| | `m` | Add/remove mark at current line | | | `m/` | List all marks | | | `m` | Jump to the next mark in buffer | | For more commands, see [here](https://github.com/MattesGroeger/vim-bookmarks#usage) #### vim-table-mode Toggle "Table Editing Mode" with `tm` (equals to command `:TableModeToggle`) #### vim-multiple-cursors | Shortcut | Action | |------------|-------------------------------------| | `Ctrl`+`k` | Select next word (multiple cursors) | | `Ctrl`+`p` | Select previous word | | `Ctrl`+`x` | Skip word | | `Esc` | Quit mutiple cursors | #### vim-surround To add surround (`string` -> `"string"`): ``` string ``` press: `yskw'`: ``` 'string' ``` To change surround ``` 'string' ``` press: `cs'"`: ``` "string" ``` #### vim-calc Press `Space` + `a` to calculate the equation in the current line ## Custom Snippets #### Markdown | Shortcut | what it creates | |----------|---------------------| | `,n` | --- | | `,b` | **Bold** text | | `,s` | ~~sliced~~ text | | `,i` | *italic* text | | `,d` | `code block` | | `,c` | big `block of code` | | `,m` | - [ ] check mark | | `,p` | picture | | `,a` | [link]() | | `,1` | # H1 | | `,2` | ## H2 | | `,3` | ### H3 | | `,4` | #### H4 | | `,l` | -------- | `,f` to go to the next `` (placeholder) `,w` to go to the next `<++>` (placeholder) and then press `Enter` for you ## 其他有用的东西 #### Press `fd` to highlight adjacent duplicated words #### Press `tx` and enter your text `tx Hello` ``` _ _ _ _ | | | | ___| | | ___ | |_| |/ _ \ | |/ _ \ | _ | __/ | | (_) | |_| |_|\___|_|_|\___/ ```