Skip to content

Instantly share code, notes, and snippets.

@andreibosco
Last active May 16, 2020 23:35
Show Gist options
  • Save andreibosco/3c8d3d7b9e3346926e9bdeb8fd972461 to your computer and use it in GitHub Desktop.
Save andreibosco/3c8d3d7b9e3346926e9bdeb8fd972461 to your computer and use it in GitHub Desktop.

Revisions

  1. andreibosco revised this gist May 16, 2020. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion vim-tips.md
    Original file line number Diff line number Diff line change
    @@ -91,4 +91,7 @@ To jump between changes and stage/discard individual hunks:

    ### Ack
    Search pattern in files.
    - `:Ack [options] {pattern} [{directories}]`
    - `:Ack [options] {pattern} [{directories}]`

    ### Auto-pairs
    https://github.com/jiangmiao/auto-pairs
  2. andreibosco revised this gist May 16, 2020. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions vim-tips.md
    Original file line number Diff line number Diff line change
    @@ -88,3 +88,7 @@ To jump between changes and stage/discard individual hunks:
    - `Leader+c<space>`: Toggles the comment state of the selected line(s). If the topmost selected line is commented, all selected lines are uncommented and vice versa.
    - `Leader+cm`:Comments the given lines using only one set of multipart delimiters.
    - `Leader+cs`:Comments out the selected lines with a pretty block formatted layout.

    ### Ack
    Search pattern in files.
    - `:Ack [options] {pattern} [{directories}]`
  3. andreibosco revised this gist May 16, 2020. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion vim-tips.md
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,7 @@
    ## Tips

    ### General
    - The standard Vim Leader key is the `\` character.
    - Close all buffers and quit: `:qa`
    - Save all buffers and quit: `:wqa`
    - To run terminal commands: `:!command`
    @@ -79,4 +80,11 @@ To jump between changes and stage/discard individual hunks:
    - `]c`: GitGutterNextHunk
    - `[c`: GitGutterPrevHunk
    - `<Leader>hs`: GitGutterStageHunk
    - `<Leader>hu`: GitGutterUndoHunk
    - `<Leader>hu`: GitGutterUndoHunk

    ### NERD-commenter
    - `Leader+cc`: Comment out the current line or text selected in visual mode.
    - `Leader+cn`: Same as cc but forces nesting.
    - `Leader+c<space>`: Toggles the comment state of the selected line(s). If the topmost selected line is commented, all selected lines are uncommented and vice versa.
    - `Leader+cm`:Comments the given lines using only one set of multipart delimiters.
    - `Leader+cs`:Comments out the selected lines with a pretty block formatted layout.
  4. andreibosco revised this gist May 16, 2020. 1 changed file with 20 additions and 1 deletion.
    21 changes: 20 additions & 1 deletion vim-tips.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,7 @@
    - [Vim cheatsheet](https://devhints.io/vim)

    ## Guides
    (Most of the stuff in here comes from these guides)
    - [10 essential Vim plugins for 2018](https://medium.com/@huntie/10-essential-vim-plugins-for-2018-39957190b7a9)
    - [Top 10 Vim plugins for programming in multiple languages](https://opensource.com/article/19/11/vim-plugins)
    - [How I boosted my Vim](https://nvie.com/posts/how-i-boosted-my-vim/)
    @@ -60,4 +61,22 @@ To make a basic selection, use the `Ctrl+N` keystroke in normal mode, followed b
    - `I` – insert at start of range.
    - `A` – insert at end of range.

    More actions can be found in the plugin’s [quick start](https://github.com/terryma/vim-multiple-cursors#quick-start) information.
    More actions can be found in the plugin’s [quick start](https://github.com/terryma/vim-multiple-cursors#quick-start) information.

    ### vim-eunuch
    This cryptically-named plugin adds a dozen core Unix file operations as Vim commands in the context of the current file.
    ```
    :Rename new_name.sh
    :Chmod +x
    :SudoWrite
    ```

    ### surround
    It's easier to just check the project examples: https://github.com/tpope/vim-surround

    ### git-gutter
    To jump between changes and stage/discard individual hunks:
    - `]c`: GitGutterNextHunk
    - `[c`: GitGutterPrevHunk
    - `<Leader>hs`: GitGutterStageHunk
    - `<Leader>hu`: GitGutterUndoHunk
  5. andreibosco revised this gist May 16, 2020. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion vim-tips.md
    Original file line number Diff line number Diff line change
    @@ -49,4 +49,15 @@ You can also use the resize commands:
    - `:resize [+-]N`: resize a horizontal split, increasing or decreasing height by N characters.
    - `:vertical resize [+-]N`: resize a vertical split, increasing or decreasing height by N characters.
    - `:resize N`: resize a horizontal split, setting height to N characters.
    - `:vertical resize N`: resize a vertical split, setting width to N characters.
    - `:vertical resize N`: resize a vertical split, setting width to N characters.

    ## Plugins commands

    ### vim-multiple-cursor
    To make a basic selection, use the `Ctrl+N` keystroke in normal mode, followed by a motion:

    - `c` – change text.
    - `I` – insert at start of range.
    - `A` – insert at end of range.

    More actions can be found in the plugin’s [quick start](https://github.com/terryma/vim-multiple-cursors#quick-start) information.
  6. andreibosco revised this gist May 16, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vim-tips.md
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,7 @@
    ### General
    - Close all buffers and quit: `:qa`
    - Save all buffers and quit: `:wqa`
    - To run terminal commands: `:!command`

    ### Navigating tabs
    - New tab: `tabnew` or `CTRL+t` (if using my `.vimrc` file)
  7. andreibosco revised this gist May 16, 2020. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion vim-tips.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # VIM - Useful links
    # VIM - Useful stuff

    ## Plugins
    - [Minimalist Vim Plugin Manager](https://github.com/junegunn/vim-plug)
    @@ -43,3 +43,9 @@
    - `Ctrl+W _`: set height (ex. 50<C-w>_)
    - `Ctrl+W |`: set width (ex. 50<C-w>|)
    - `Ctrl+W =`: equalize width and height of all windows

    You can also use the resize commands:
    - `:resize [+-]N`: resize a horizontal split, increasing or decreasing height by N characters.
    - `:vertical resize [+-]N`: resize a vertical split, increasing or decreasing height by N characters.
    - `:resize N`: resize a horizontal split, setting height to N characters.
    - `:vertical resize N`: resize a vertical split, setting width to N characters.
  8. andreibosco renamed this gist May 16, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  9. andreibosco revised this gist May 16, 2020. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion vim-links.md
    Original file line number Diff line number Diff line change
    @@ -27,12 +27,16 @@
    - Close all other tabs: `:tabo` or `:tabonly`

    ### Window/splits
    #### Splitting
    - `Ctrl+W v`: split vertically
    - `Ctrl+W s`: split horizontally

    #### Navigating
    - `Ctrl+W hjkl`: change focus of current windows split
    - `hjkl` are the keys that vim uses instead of the arrow keys (h = left, j = bottom, k = up, l = right)
    - `Ctrl+W HJKL`: move current window split
    - Note the uppercase, meaning you have to use shift+h, for example.

    #### Adjusting size
    - `Ctrl+W +/-`: increase/decrease height (ex. 20<C-w>+)
    - `Ctrl+W >/<`: increase/decrease width (ex. 30<C-w><)
  10. andreibosco revised this gist May 16, 2020. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions vim-links.md
    Original file line number Diff line number Diff line change
    @@ -27,6 +27,13 @@
    - Close all other tabs: `:tabo` or `:tabonly`

    ### Window/splits
    #### Navigating
    - `Ctrl+W hjkl`: change focus of current windows split
    - `hjkl` are the keys that vim uses instead of the arrow keys (h = left, j = bottom, k = up, l = right)
    - `Ctrl+W HJKL`: move current window split
    - Note the uppercase, meaning you have to use shift+h, for example.

    #### Adjusting size
    - `Ctrl+W +/-`: increase/decrease height (ex. 20<C-w>+)
    - `Ctrl+W >/<`: increase/decrease width (ex. 30<C-w><)
    - `Ctrl+W _`: set height (ex. 50<C-w>_)
  11. andreibosco revised this gist May 16, 2020. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion vim-links.md
    Original file line number Diff line number Diff line change
    @@ -24,4 +24,11 @@
    - Next tab: `gt`
    - Prior tab: `gT`
    - Numbered tab: `tabnumber gt`
    - Close all other tabs: `:tabo` or `:tabonly`
    - Close all other tabs: `:tabo` or `:tabonly`

    ### Window/splits
    - `Ctrl+W +/-`: increase/decrease height (ex. 20<C-w>+)
    - `Ctrl+W >/<`: increase/decrease width (ex. 30<C-w><)
    - `Ctrl+W _`: set height (ex. 50<C-w>_)
    - `Ctrl+W |`: set width (ex. 50<C-w>|)
    - `Ctrl+W =`: equalize width and height of all windows
  12. andreibosco revised this gist May 16, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim-links.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    ## Plugins
    - [Minimalist Vim Plugin Manager](https://github.com/junegunn/vim-plug)
    - [VimAwesome](ttps://vimawesome.com/)
    - [VimAwesome](https://vimawesome.com/)

    ## Usage
    - [Vim cheatsheet](https://devhints.io/vim)
  13. andreibosco revised this gist May 16, 2020. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions vim-links.md
    Original file line number Diff line number Diff line change
    @@ -14,9 +14,14 @@

    ## Tips

    ### General
    - Close all buffers and quit: `:qa`
    - Save all buffers and quit: `:wqa`

    ### Navigating tabs
    - New tab: `tabnew` or `CTRL+t` (if using my `.vimrc` file)
    - Close tab: `tabc`
    - Next tab: `gt`
    - Prior tab: `gT`
    - Numbered tab: `tabnumber gt`
    - Close all other tabs: `:tabo` or `:tabonly`
  14. andreibosco revised this gist May 16, 2020. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion vim-links.md
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,13 @@
    ## Guides
    - [10 essential Vim plugins for 2018](https://medium.com/@huntie/10-essential-vim-plugins-for-2018-39957190b7a9)
    - [Top 10 Vim plugins for programming in multiple languages](https://opensource.com/article/19/11/vim-plugins)
    - [How I boosted my Vim](https://nvie.com/posts/how-i-boosted-my-vim/)
    - [How I boosted my Vim](https://nvie.com/posts/how-i-boosted-my-vim/)

    ## Tips

    ### Navigating tabs
    - New tab: `tabnew` or `CTRL+t` (if using my `.vimrc` file)
    - Close tab: `tabc`
    - Next tab: `gt`
    - Prior tab: `gT`
    - Numbered tab: `tabnumber gt`
  15. andreibosco revised this gist May 16, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim-links.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    ## Plugins
    - [Minimalist Vim Plugin Manager](https://github.com/junegunn/vim-plug)
    - [VimAwesome]https://vimawesome.com/
    - [VimAwesome](ttps://vimawesome.com/)

    ## Usage
    - [Vim cheatsheet](https://devhints.io/vim)
  16. andreibosco revised this gist May 16, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion vim-links.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,8 @@
    # VIM - Useful links

    ## Plugin Manager
    ## Plugins
    - [Minimalist Vim Plugin Manager](https://github.com/junegunn/vim-plug)
    - [VimAwesome]https://vimawesome.com/

    ## Usage
    - [Vim cheatsheet](https://devhints.io/vim)
  17. andreibosco revised this gist May 16, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vim-links.md
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,5 @@

    ## Guides
    - [10 essential Vim plugins for 2018](https://medium.com/@huntie/10-essential-vim-plugins-for-2018-39957190b7a9)
    - [Top 10 Vim plugins for programming in multiple languages](https://opensource.com/article/19/11/vim-plugins)
    - [How I boosted my Vim](https://nvie.com/posts/how-i-boosted-my-vim/)
  18. andreibosco renamed this gist May 16, 2020. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions vim-guides.md → vim-links.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,11 @@
    # VIM - Useful links

    ## Plugin Manager
    - [Minimalist Vim Plugin Manager](https://github.com/junegunn/vim-plug)

    ## Usage
    - [Vim cheatsheet](https://devhints.io/vim)

    ## Guides
    - [10 essential Vim plugins for 2018](https://medium.com/@huntie/10-essential-vim-plugins-for-2018-39957190b7a9)
    - [How I boosted my Vim](https://nvie.com/posts/how-i-boosted-my-vim/)
  19. andreibosco revised this gist May 16, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions vim-guides.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    - [Minimalist Vim Plugin Manager ]https://github.com/junegunn/vim-plug
    - [10 essential Vim plugins for 2018]https://medium.com/@huntie/10-essential-vim-plugins-for-2018-39957190b7a9
    - [How I boosted my Vim]https://nvie.com/posts/how-i-boosted-my-vim/
    - [Minimalist Vim Plugin Manager](https://github.com/junegunn/vim-plug)
    - [10 essential Vim plugins for 2018](https://medium.com/@huntie/10-essential-vim-plugins-for-2018-39957190b7a9)
    - [How I boosted my Vim](https://nvie.com/posts/how-i-boosted-my-vim/)
  20. andreibosco created this gist May 16, 2020.
    3 changes: 3 additions & 0 deletions vim-guides.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    - [Minimalist Vim Plugin Manager ]https://github.com/junegunn/vim-plug
    - [10 essential Vim plugins for 2018]https://medium.com/@huntie/10-essential-vim-plugins-for-2018-39957190b7a9
    - [How I boosted my Vim]https://nvie.com/posts/how-i-boosted-my-vim/