Last active
July 23, 2024 11:01
-
-
Save tdewin/a525108f535a276aeefe00c5f9c0db34 to your computer and use it in GitHub Desktop.
VIM shortcuts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"when you use > or < on a V[isual] selected text, shift 2 spaces | |
set shiftwidth=2 | |
"makes space no tabs | |
set expandtab | |
"put 2 spaces for a tab | |
set tabstop=2 | |
"indicates lines and character location | |
set ruler | |
"remap leader from / to , | |
:let mapleader="," | |
"when you type ,k : write the file | apply the current file (%) | |
"you need to save the file one first time before this can work | |
:nmap <Leader>k <ESC>:w <bar> :!kubectl apply -f % | |
"when you type ,e : go to the beginning of the line, find :, go to the right 1 char, delete until the end $ and add a space | |
:nmap <Leader>e <ESC>0f:lc$<space> | |
"when you type ,q : quote the word | |
:nmap <Leader>q <ESC>viw<ESC>bi"<ESC>viw<ESC>ea" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"put the current line in reg, then goes in to expression mode, adds space=space, enter get result | |
:let mapleader="," | |
:nnoremap <leader>c A=<esc>0f=c$<esc>v0"ayA<space>=<space><c-r>=<c-r>a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment