adding abbreviations

This commit is contained in:
gre-ilya 2025-06-29 17:15:14 +05:00
parent 4ada6d83c9
commit 465233940d
2 changed files with 86 additions and 21 deletions

26
.vimrc
View File

@ -3,27 +3,37 @@
filetype off filetype off
set number set number
"INDENT config "INDENT config
filetype plugin indent on filetype plugin indent on
" show existing tab with 4 spaces width "" show existing tab with 8 spaces width
set tabstop=4 set tabstop=8
"
" when indenting with '>', use 4 spaces width "" when indenting with '>', use 4 spaces width
set shiftwidth=4 set shiftwidth=4
"
" On pressing tab, insert 4 spaces "" On pressing tab, insert 4 spaces
set expandtab set expandtab
set autoindent
"MACROS config "MACROS config
vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left> vnoremap <C-R> "hy:%s/<C-r>h//gc<left><left><left>
nnoremap <C-S> :w<CR> nnoremap <C-S> :w<CR>
"LaTEX config "LaTEX config
vnoremap <C-b> c{\bfseries <C-r>"}<Esc> vnoremap <C-b> c{\bfseries <C-r>"}<Esc>
vnoremap <C-t> c{\<C-r>"}<Esc>%2li<Space><Esc>i
"PLUGIN config "PLUGIN config
let g:NERDTreeNodeDelimiter = "\u00a0" let g:NERDTreeNodeDelimiter = "\u00a0"
execute "set <M-n>=\en" execute "set <M-n>=\en"
nnoremap <M-n> :NERDTree<CR> nnoremap <M-n> :NERDTree<CR>
"MACROS
"PASCAL
:iab fii <Esc>^ifunction <Esc>eli(<Esc>lxea: integer): integer;<CR>
\begin<CR>
\end;<Esc>O<BS>

View File

@ -1,5 +1,4 @@
Commands: Commands:
ZZ -- write out and exit ZZ -- write out and exit
75 i ! <Esc> -- insert "!" 75 times 75 i ! <Esc> -- insert "!" 75 times
75 a ! <Esc> -- append "!" 75 times 75 a ! <Esc> -- append "!" 75 times
@ -251,8 +250,8 @@ Commands:
BTW it's possible to edit compressed formats (.Z, .gz, .bz2) BTW it's possible to edit compressed formats (.Z, .gz, .bz2)
Making corrections (24): Making corrections (24):
CTRL-W -- delete word CTRL-W -- delete word (in insert mode)
CTRL-U -- delete until beginning CTRL-U -- delete until beginning (in insert mode)
CTRL-P -- complete the word or repeate previous. (P)revious CTRL-P -- complete the word or repeate previous. (P)revious
CTRL-N -- complete the word. (N)ext CTRL-N -- complete the word. (N)ext
There is OMNI completion (like intelisence). Check it out later. There is OMNI completion (like intelisence). Check it out later.
@ -317,6 +316,62 @@ Commands:
It's all about shrimping a bunch of lines to one. It's all about shrimping a bunch of lines to one.
=== I SKIPED REST OF TUTOR, BACK LATER === === I SKIPED REST OF TUTOR, BACK LATER ===
Moving through programs (29):
ctags *.c -- to generate the tags file for all C files in the current
directory
:tag function_name -- jump to function definition
CTRL-] -- jump to the definition of the function under cursor
CTRL-T -- jump back
:tags -- show the list of tags that you traversed through
:stag tagname -- open new window with file from tag under cursor
CTRL-W ] -- split the current window and jump to the tag under the
cursor. If a count is specified, the new window will be that many lines
high.
ctags -R . -- generate tags from the whole directory tree
:tnext -- go to next tag match
:tprevious -- go to previous tag match
:tfirst -- go to first tag match
:tlast -- go to last match
Mini recipe:
vim
:vsplit functions
:nnoremap <buffer> <CR> 0ye<C-W>w:tag <C-R>"<CR>
CTRL-W } -- open tag preview
% -- on #if, #endif, #endif: jump on macros processor instructions
[# OR ]# -- if cursor inside preprocessor macroses, you will jump on
BEGININ or END of that macros
[[ OR ][ -- jump on begin or end of the outer code block
[{ OR ]} -- jump on begin or end of the current code block
[( OR ]) -- like above, but works with curle braces
]] -- move forward to the start of the next function
[] -- move backward to the end of other function
[/ OR ]/ -- move back to the start of a comment (/* */)
[I -- find definition of the variable under cursor
[<Tab> -- next definition
gd -- jump on the variable declaration in the current subprogram
gD -- jump on the variable declaration in the current file
Editing programs (30):
:make {arguments} -- compile a program
:cnext -- move to the next error from program compiling
:cc -- show whole error message
:clist -- get overview of all error messages
:clist! -- see all messages from compiler
:cfirst -- to the first errorc
:clast -- to the last error
:cc 3 -- to error 3
You can also change Make to other autobuild tool
:colder / :cnewer -- jump to the previous or next error list
:compiler msvc -- switch compiler to other
:set cindent shiftwidth=4 -- turn on automatically indent
== -- re-indent current line
VISUAL BLOCK + = -- reindent selected lines
=a{ -- reindent current block
gg=G -- reindent the whole file
LOOK for cinoption-values to configure reindent configuration in VIM
:filetype indent on -- switch on the 'cindent' option manually every
time you edit a file
Hints: Hints:
There is lowercase and uppercase marks. Uppercase marks are global, they There is lowercase and uppercase marks. Uppercase marks are global, they