Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gaveen/vimfiles

My Vimfiles
https://github.com/gaveen/vimfiles

vim vimfiles

Last synced: about 1 month ago
JSON representation

My Vimfiles

Awesome Lists containing this project

README

        

# Vimfiles

This is my current vim (and gvim) setup files.

There are many like it but this one is mine. This is not intended as a distribution. Therefore, you can expect things to change on a whim. Feel free to look around and steal ideas though.

I have explained about this setup in [a blog post](https://gaveen.me/2020/02/my-vim-story/). The plugins are managed with '[`vim-plug`](https://github.com/junegunn/vim-plug)' and the setup is tested only on [Vim](https://www.vim.org/) > v9.0 on Linux.

I have a separate configuration setup for Neovim in the repository [neovimfiles](https://github.com/gaveen/neovimfiles/) because I set it up with additional features.

## How to use
If you still want to use these vimfiles, this is how you can do so.

First, you'll need to clone this repository. 
`$ git clone https://github.com/gaveen/vimfiles.git`

Then, you could create symbolic links to the `.vim` directory and `.vimrc` file. Assuming the location where you cloned the repository is `~/Apps/vimfiles`, you can do something like: 
`$ ln -s ~/Apps/vimfiles/.vim ~/.vim` 
`$ ln -s ~/Apps/vimfiles/.vimrc ~/.vimrc`

Finally, launch vim and install the plugins. (_Note:_ `:PlugUpgrade` will update vim-plug itself) 
`:PlugUpdate` will install/update plugins

The **Leader** key is set as the `Space` character.

### Dependencies
- A relatively newer version of vim/gvim
- An internet connection (to install/update plugins)
- `git` used by `vim-plug` to keep plugins up-to-date
- `wl-copy` used for copying to clipboard (over Wayland)
- `wmctrl` used for gvim toggle full-screen
- `ctags` used for traversing by tags

## Usage tips & tricks

Before we begin tricks, there are few key concepts you need to know if you are new to vim.

To summarize:
- Vim has multiple modes (e.g., `Normal Mode`, `Insert Mode`, `Visual Mode`)
- Vim `buffers` are different editing spaces, whereas vim `tab pages` are not
- You can define your own shortcuts
- Vim is extensible with plugins
- Editing with Vim is like programming your text

You can read the full details at: https://gaveen.me/2020/02/my-vim-story/

 

With those out of the way, here are some of the tricks you can do with this particular setup of vimfiles. Some of the following are enabled through plugins.

_Please note:_ **`` = ` `** in this vimfiles setup

Function Key | Action
------------ | ------
`F2` | Toggle auto-indenting when pasting
`F3` | Toggle focus-highlighting (plugin)
`F4` | Toggle spell checking (default lang: en_US)
`F7` | Toggle vista (plugin)
`F8` | Toggle tagbar (plugin)
`F10` | Trigger showing a margin (with user input)
`F11` | Toggle fullscreen in gvim (if supported)

 

Buffer Shortcut | Action
--------------- | ------
`bl` | List open buffers
`bg` | Trigger jump to buffer (with user input)
`bv` | Go to previous buffer
`bn` | Go to next buffer
`bd` | Close buffer and jump to previous one

 

Clipboard Shortcut* | Action
------------------- | ------
`y` | Copy to clipboard
`x` | Cut to clipboard
`p` | Paste from clipboard
`*` | _Only on supported systems_

 

Motion Shortcut | Action
--------------- | ------
`w` | Trigger jump to word motion
`p` | Fuzzy find pattern in files, buffers, etc.
`` | Jump to matching other of a pair (same as %)

 

Visual Cue Shortcut | Action
------------------- | ------
`,` | Compare the changes since the last save
`/` | Clear the highlighting of last searched pattern
`l` | Toggle displaying non-printable characters
`v` | Select the text that was pasted immediately before
`za` | Toggle code folding based on syntax

 

UI Element Shortcut | Action
------------------- | ------
`d` | Toggle directory tree pane
`q` | Toggle displaying the quickfix window

 

Text Manipulation Shortcut | Action
-------------------------- | ------
`c` | Toggle commenting the selected text
`j=` | Toggle soft-wrapping text (fit to screen)
`gq` | Hard-wrap lines in the current paragraph
`J` | Un-wrap the current paragraph (join lines)
`W` | Remove trailing whitespaces in current file
`z=` | Spelling suggestion for the word under cursor
`:w!!` | Save a file with 'sudo' privileges

 

Insert Mode Shortcut* | Action
--------------------- | ------
`n` | Auto-complete words repeating words
`xo` | Auto-complete code keywords
`*` | _Entered while in Insert Mode_

 

Here are some other useful things enabled for you.
- Automatic completion of matching pairs (e.g., `()`, `[]`, `{}`, `''`, `""`, etc.)
- Auto-editing of matching pairs (For examples, see: [tpope/vim-surround](https://github.com/tpope/vim-surround))
- Use _ and + keys to increase and decrease the range of text selection blocks
- Better text aligning support (For examples, see: [Vimcasts - Aligning text with Tabular.vim](http://vimcasts.org/episodes/aligning-text-with-tabular-vim/))
- Show non printable characters such as: tab, trailing spaces
- List and indicate open/active buffers in the bottom status bar

 

## Finding more help
Since Vim is an advanced editor and plugins add even more features, it doesn't make sense for me to include all the support in the scope of this document.

Vim comes with extensive help documentation. To find out more about a given topic, you can access the vim help by typing :h {topic}. For example, to find about Vim's text folding features, type `:h folding`.

At least some of the plugins also come with documentation. Therefore, please try to refer the relevant documetation the same way. For example, to find more about motion shortcuts enabled by EasyMotion plugin, type `:h easymotion`.