Skip to content

Commit 846ad57

Browse files
committed
Initial Commit
1 parent f4275c3 commit 846ad57

File tree

4 files changed

+511
-0
lines changed

4 files changed

+511
-0
lines changed

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# vim-commands
2+
3+
A vim plugin to provide a quick cheat sheet for common vim commands rather than
4+
going online to search for the specific commands.
5+
6+
## Demo
7+
8+
Sometimes you can forgot how to do a specific thing in vim(we all been there :innocent:).
9+
10+
## Installation
11+
12+
- Using **Vim-Plug**
13+
Add the following to your `.vimrc`:
14+
15+
```bash
16+
Plug 'https://github.com/Var7600/vim-commands'
17+
```
18+
19+
- then run `:PlugInstall` in Vim.
20+
21+
- Using **Pathogen**
22+
23+
```bash
24+
git clone https://github.com/Var7600/vim-commands ~/.vim/bundle/vim-commands
25+
```
26+
27+
- Using **Vundle**
28+
29+
```bash
30+
Plugin 'Var7600/vim-commands'
31+
```
32+
- then run `:PlugInstall` in Vim.
33+
34+
## Usage
35+
36+
- to open the cheat sheet , simply type
37+
38+
```bash
39+
:Shortcuts
40+
```
41+
## SEARCH BY SECTION
42+
the cheat sheet contents differents sections that you can search for **ALL SECTION ARE IN UPPERCASE**
43+
- Basic (vim commands)
44+
- NAVIGATION (move,jump,position in file)
45+
- JUMPS (location,last modified position,...)
46+
- DELETION (delete character,word,line,until cursor,until end line)
47+
- NORMAL MODE -> INSERT MODE(to pass from normal mode to insert mode)
48+
- CUT,COPY&PASTE (cut,copy and paste portions of text)
49+
- SEARCH (search word,pattern,...)
50+
- REPLACE (replace occurrences by another)
51+
- CASE (modify case of a character,word,entire line,...)
52+
- TABS (creates,navigate,move,close tabs)
53+
- SPLIT (split horizontally,vertically,switch panes,resize,...)
54+
- BUFFERS (create,navigate,list,close buffer)
55+
- FILE EXPLORER (built-in-file Explorer)
56+
- SHELL (using shell commands in vim)
57+
- ALIGNMENT (align lines for better clarity)
58+
- READ AND WRITE FILES (insert the content of a file into another,export portions,...)
59+
- MARKS (marks section of a file,line numbers,...)
60+
- ABBREVATIONS (define your own abbreviations)
61+
- TEXT INDENTATION (indent text for readability,...)
62+
- CTAGS (if installed,allow quick access across files for definitions and functions)
63+
64+
## Customization
65+
66+
You can place your own cheat sheet at `$HOME/cheatSheet/vim-commands.md`.The plugin will
67+
prioritize this file over the default one in `vim-commands/doc/vim-commands.md`.
68+
69+
## Contributing
70+
71+
Contributions are welcome! Please open an issue or submit a pull request.
72+
73+
## License
74+
75+
MIT License.

autoload/vim_commands_plugin.vim

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function! vim_commands_plugin#openCheatSheet()
2+
" Path to the user's customized cheat sheet
3+
let l:user_cheat_sheet = expand('$HOME/cheatsheet/vim-commands.md')
4+
5+
" Check if the user's cheat sheet exists
6+
if filereadable(l:user_cheat_sheet)
7+
let l:cheat_sheet = l:user_cheat_sheet
8+
else
9+
" get the plugin directory path
10+
let l:plugin_dir = expand('<sfile>:p:h:h')
11+
" Construct the path to the cheat sheet
12+
let l:cheat_sheet = l:plugin_dir . '/doc/vim-commands.md'
13+
endif
14+
15+
" Open the markdown file in a new buffer
16+
execute 'edit' l:cheat_sheet
17+
endfunction

0 commit comments

Comments
 (0)